Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaÁ¬½ÓSQL Server 2000

Êý¾Ý¿â²Ù×÷ÏÖÔÚÊÇÏîÄ¿¿ª·¢µÄ¸ù±¾£¬Ñ§Ï°JavaÊ×ÏÈÓ¦¸Ãѧ»áÔõôÑùÁ¬½ÓÊý¾Ý¿â£¬ÓÃJavaÁ¬½ÓÊý¾Ý¿â¿É²»ÏñÓÃDelphiÕâÀ๤¾ßÄÇÑùÉ輸¸öÊôÐÔ¾ÍOK£¬Ëµ¼òµ¥Ò²¼òµ¥£¬Ëµ¸´ÔÓ£¬ÆäʵҲͦ¸´Ôӵģ¬¶øÇÒºÜÂé·³£¬Èç¹ûÊdzõѧ£¬¸ù±¾²»Äܱ£Ö¤µÚÒ»´Î¾ÍÁ¬½Ó³É¹¦£¬ÏÂÃæÒÔSQL Server 2000ΪÀý£¬ËµËµJavaÁ¬½ÓÊý¾Ý¿âµÄ»ù±¾·½·¨£¬Ò²¼Ç¼һÏÂÐĵá£
1¡¢ÏÂÔØSQL Server 2000 driver for JDBC
SQL Server 2000 Driver For JDBC Downloads
¸ÃÇý¶¯½ØֹĿǰÓÐËĸö°æ±¾£¬½¨ÒéÏÂÔØ×îеÄSP3°æ¡£
¸ÃÇý¶¯°²×°³É¹¦ºó£¬Ç뽫°²×°Ä¿Â¼ÏµÄlibĿ¼ÏµÄÈý¸ö.jarÎļþ¼Óµ½CLASSPATHÖУ»Èç¹ûÄãʹÓõÄÊÇJBuilder»òEclipse£¬½«ÕâÈý¸öÎļþ¸ù¾ÝIDEµÄÌáʾ¼Óµ½¹¤³ÌÖÐÒ²¿É¡£
2¡¢Éý¼¶ÄãµÄSQL Server 2000£¬ÎªÆä´òÉÏ×îеIJ¹¶¡¡£
ÕâÒ»²½¿ÉÄܲ»ÊDZØÐèµÄ£¬Òò²Ù×÷ϵͳ»·¾³¶ø¶¨£¬ÔÚ²»´ò²¹¶¡µÄÇé¿ö£¬ÓÐʱ¿ÉÒÔÕý³£Á¬½Ó£¬ÓÐʱȴ²»ÄÜ£¬ËùÒÔ½¨Ò黹ÊÇ°²×°×îеÄSQL Server 2000²¹¶¡£¨SP4£©ºÍJDBCÇý¶¯£¨SP3£©¡£
Èç¹ûÄãµÄ³ÌÐòÔÚÔËÐÐʱÌáʾ£ºError establishing socket£¬Ò»°ãÇé¿öÏ£¬´òÉÏSQL Server 2000µÄ²¹¶¡¾Í¿É½â¾ö¡£
3¡¢Çý¶¯µÄ¼ÓÔØ·½·¨
ÔÚ½¨Á¢Á¬½Ó֮ǰ£¬ÒªÏȼÓÔØSQL Server 2000 JDBCµÄÇý¶¯£¬´úÂëÐÎʽÈçÏ£º
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
ÔÚ´Ë×¢Ò⣬forName·½·¨µÄ²ÎÊý×Ö·û´®±ØÐëÍêÈ«ÏàͬÓÚÒÔÉÏÄÚÈÝ£¬´óСдÊÇÇø·ÖµÄ£¬ÆäʵÕâ¸ö´®¾ÍÊÇÇý¶¯ÀàµÄÍêÕûÃû³Æ£º°üÃû+ÀàÃû¡£
4¡¢»ñµÃÒ»¸öÁ¬½Ó
ÔÚ²Ù×÷Êý¾Ý¿â֮ǰ£¬ÒªÏÈ»ñµÃÓëÊý¾Ý¿âµÄÒ»¸öÁ¬½Ó£¬Ê¹ÓÃÈçÏ´úÂë¸ñʽ£º
DriverManager.getConnection(Á¬½Ó×Ö·û´®, µÇ¼Óû§Ãû, µÇ¼ÃÜÂë);
Àý£º
DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433; DatabaseName=pubs", "sa", "");
ÔÚ´Ë´¦¹Ø¼üµÄÊÇÁ¬½Ó×Ö·û´®µÄÄÚÈÝ£¬localhost²¿·Ö¼´·þÎñÆ÷µÄÃû×Ö£¬¿ÉÒÔ¸ü¸Ä£»1433²¿·ÖΪSQL ServerʹÓõĶ˿ںţ¬¸ù¾Ýʵ¼ÊÇé¿öÐ޸ļ´¿É£»DatabaseName¼´ÎªÒªÁ¬½ÓµÄÊý¾Ý¿âµÄÃû×Ö£¬ÔÚ´Ë×¢ÒâDatabaseName֮ǰµÄÊǷֺţ¬¶ø²»ÊÇðºÅ¡£
5¡¢´úÂëʵÀý
// µ¼ÈëJava SQL°ü£¬Á¬½ÓÊý¾Ý¿â±ØÐ裻
import java.sql.*;
public class TestDB {
public static void main(String[] args) {
String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String dbURL = "jdbc:microsoft:sqlserver://localhost:1433; DatabaseName=pubs";
String userName = "sa";
String userPwd = "";
Connection dbCo


Ïà¹ØÎĵµ£º

JAVAÃæÊÔÌ⼯

                                     JAVAÃæÊÔÌ⼯
1.Êý¾Ý¿â£¬±ÈÈç100Óû§Í¬Ê±À´·Ã£¬Òª²Éȡʲô¼¼Êõ½â¾ö£»(JDBC)
´ð£º¿É²ÉÓà ......

JavaÏß³ÌÐÂÌØÕ÷ Ï̳߳Ø

SunÔÚJava5ÖУ¬¶ÔJavaÏ̵߳ÄÀà¿â×öÁË´óÁ¿µÄÀ©Õ¹£¬ÆäÖÐÏ̳߳ؾÍÊÇJava5µÄÐÂÌØÕ÷Ö®Ò»£¬³ýÁËÏ̳߳ØÖ®Í⣬»¹Óкܶà¶àÏß³ÌÏà¹ØµÄÄÚÈÝ£¬Îª¶àÏ̵߳ıà³Ì´øÀ´Á˼«´ó±ãÀû¡£ÎªÁ˱àд¸ßЧÎȶ¨¿É¿¿µÄ¶àÏ̳߳ÌÐò£¬Ï̲߳¿·ÖµÄÐÂÔöÄÚÈÝÏÔµÃÓÈΪÖØÒª¡£
 
ÓйØJava5Ïß³ÌÐÂÌØÕ÷µÄÄÚÈÝÈ«²¿ÔÚjava.util.concurrentÏÂÃ棬ÀïÃæ°üº¬ÊýÄ¿ÖÚ¶à ......

JAVA±Ê¼Ç£¨Ò»£©

javaÓïÑÔÊǽâÊÍÖ´ÐУ¬javaÔ´ÂëÊÇͨ¹ý±àÒëÉú³ÉÒ»ÖÖÌØÊâµÄ.classµÄÖмä×Ö½âÂëÎļþ£¬È»ºóÔÙÓÐJVM½øÐнâÊÍÖ´ÐС£
javaÓïÑÔ¶ÔÖ¸Õë½øÐÐÁËÉϲãµÄ·â×°£¬Ëü±£Ö¤Äܹ»Í¨¹ýÕâ¸öÖ¸Õ루ÒýÓã©£¬À´·ÃÎÊÓÐЧµÄÄÚ´æµ¥Ôª¡£
javaÓïÑÔ²»ÔÊÐí¶à¼Ì³Ð£¬Ê¹¼Ì³Ð¹Øϵ³ÉÊ÷װͼ£¬Ã¿¸öÀ඼ֻÄÜÓÉÒ»¸ö¸¸Àà¡£
javaÓïÑԵĿª·¢Ð§Âʸߣ¬µ«Ö´ÐÐЧÂʵ͡££¨Ïൠ......

JAVA±Ê¼Ç£¨ËÄ£©

ÃæÏò¶ÔÏóµÄÈý´óÌØÕ÷£º·â×°¡¢¼Ì³Ð¡¢¶à̬¡£
javaÖеķâ×°
·â×°£¬Ò»¸ö¶ÔÏóºÍÍâ½çµÄÁªÏµÓ¦µ±Í¨¹ýÒ»¸öͳһµÄ½Ó¿Ú£¬Ó¦µ±¹«¿ªµÄ¹«¿ª£¬Ó¦µ±Òþ²ØµÄÒþ²Ø¡££¨¶ÔÏóµÄÊôÐÔÓ¦µ±Òþ²Ø£©£¬Ò»¸ö¶ÔÏóµÄÄÚ²¿ÊÇ͸Ã÷µÄ£¬¾ÍÊǰѶÔÏóÄÚ²¿µÄ¿É͸Ã÷ÐÔºÍÒþ²ØµÄÌØÐÔÇø·Ö¿ª£¬¸Ã͸Ã÷µÄ͸Ã÷£¬¸ÃÒþ²ØµÄÒþ²Ø¡£
£¨·â×°µÄÊôÐÔ£©javaÖÐÀàµÄÊôÐԵķÃÎÊȨÏÞµÄĬ ......

ͨ¹ýJNIÔÚJAVAÓëC³ÌÐòÖд«µÝ²ÎÊý

Ò»¡¢±à¼­JavaÔ´Îļþ
=============================================
Hello.java
=============================================
package test;
public class Hello
{
  static
  {
    try
    {
      //´Ë´¦¼´Îª±¾µØ·½·¨ËùÔÚÁ´½Ó¿âÃû
&n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ