Java¡¢sql server 2000¼°jdbc
ÎÒÔÚѧϰ¹ØÓÚjava±à³Ì£¬ÏÖÔÚÉæ¼°µ½µÄÊÇsqlµÄÎÊÌ⣬±ÈÈçÈí¼þÑ¡Ôñ¡¢»·¾³µÄÁ¬½ÓÉèÖõÈÎÊÌ⣬¶ÔÓÚÕâЩÎÊÌâÎÒÕæÊÇÊøÊÖÎ޲߰¡£¡ÇëÇóJava±à³Ì¸ßÊִͽ̣º
1¡¢ÎÒÓõÄJavaÊÇj2sdk-1_4_2_13-nb-5_0£¬ÎÒÓÃÁËsql server2000£¬ÎÒÓÃjdbc3.0ÐÐÂð£¿ËùÓÐÁ¬½ÓÉèÖøÃÔõôÑùÉèÖã¿
2¡¢±ÈÈçÏÂÃæ³ÌÐò£º
import java.sql.*;
public class DBConnection
{
private static String driver="com.Microsoft.jdbc.sqlserver.SQLServerDriver";
private static String url="jdbc:microsoft:sqlserver://localhost:1433:DatabaseName=wen";
private static String user="sa";
private static String password="sa";
public static Connection getConnection()
{
Connection con;
try
{
Class.forName(driver);
con=DriverManager.getConnection(url,user,password);
return con;
}catch(ClassNotFoundException e)
{
System.out.println(e.getMessage());
}
catch(SQLException e)
{
System.out.println(e.getMessage());
}
return null;
}
}
½á¹ûÏÔʾ£ºException in thread "main" java.lang.NoSuchMethodError:mian
ÇëÎʸÃÔõô½â¾ö£¿Ð»Ð»
Ïà¹ØÎĵµ£º
È«±¾¡¶Êý¾Ý¿â¿ª·¢ÕâµãÊÂ-Java¿ìËÙÈëÃÅ¡·Ãâ·ÑÏÂÔØ
À´×Ô£ºhttp://zyt.howwe.net/me.php?320
Ŀ¼£ºhttp://zyt.howwe.net/ok.php?321
ÄÚÈݼò½é
¡¡¡¡Õë¶ÔJava³õѧÕß¼°ÈëÃÅÕߣ¬ÏµÍ³²ûÊöWeb¿ª·¢»ù±¾ÖªÊ¶£¬½áºÏÊý¾Ý¿âµÄ¿ìËÙÓ¦Óã¬Ê¹¶ÁÕß¿ìËÙ¿çÈëJavaÁìÓò£¬¶Ô±à³ÌÓïÑÔ²»ÔÙη¾å¡£¸ÃÊé×÷Ϊ¡¶´ÓÈËÉúÐèÒªÒýµ¼ÂÛJava¿ìËÙ¿ª·¢ ......
POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream(cfname));
HSSFWorkbook wb = new HSSFWorkbook(fs);
......
1.»ù±¾¸ÅÄîµÄÀí½â
¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺 C:\xyz\test.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸ö URL¾ø¶Ô·¾¶¡£
Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶(HTMLÖеÄÏà¶ÔĿ¼)£¬ÀýÈ磺ÔÚ ServletÖУ ......
Java ÖÐÉú³ÉÊý×ÖÖ¤ÊéÒ²ºÜ¼òµ¥µÄ¡£
1¡¢´´½¨Ö¤Êé
Java ÖÐµÄ keytool.exe £¨Î»ÓÚ JDKBin Ŀ¼Ï£©¿ÉÒÔÓÃÀ´´´½¨Êý×ÖÖ¤Ê飬ËùÓеÄÊý×ÖÖ¤ÊéÊÇÒÔÒ»ÌõÒ»Ìõ(²ÉÓñðÃûÇø±ð)µÄÐÎʽ´æÈëÖ¤Êé¿âµÄÖУ¬Ö¤Êé¿âÖеÄÒ»ÌõÖ¤Êé°üº¬¸ÃÌõÖ¤ÊéµÄ˽Կ£¬¹«Ô¿ºÍ¶ÔÓ¦µÄÊý×ÖÖ¤ÊéµÄÐÅÏ¢¡£Ö¤Êé¿âÖеÄÒ»ÌõÖ¤Êé¿ÉÒÔµ¼³öÊý×ÖÖ¤ÊéÎļþ£¬Êý×ÖÖ¤ÊéÎļþÖ»°üÀ¨ ......
ÎÒÃÇ´ó¼Ò¶¼ÖªµÀ£¬¶ÔÓÚ¾²Ì¬±äÁ¿¡¢¾²Ì¬³õʼ»¯¿é¡¢±äÁ¿¡¢³õʼ»¯¿é¡¢¹¹ÔìÆ÷£¬ËüÃǵijõʼ»¯Ë³ÐòÒÔ´ËÊÇ£¨¾²Ì¬±äÁ¿¡¢¾²Ì¬³õʼ»¯¿é£©>£¨±äÁ¿¡¢³õʼ»¯¿é£©>¹¹ÔìÆ÷¡£ÎÒÃÇÒ²¿ÉÒÔͨ¹ýÏÂÃæµÄ²âÊÔ´úÂëÀ´ÑéÖ¤ÕâÒ»µã£º
public class InitialOrderTest {
// ¾²Ì¬±äÁ¿
public static String staticField = "¾²Ì¬±äÁ¿";
// ±äÁ¿
......