javaÁ¬½ÓmysqlÊý¾Ý¿â
Ê×ÏÈ£¬ÒªÏÂÔØÒ»¸öÁ¬½ÓmysqlÊý¾Ý¿âµÄÇý¶¯³ÌÐò: mysql-connector-java-3.0.15-ga-bin.jar, Õâ¸öÇý¶¯³ÌÐò²»ÐèÒª×öÆäËüÅäÖÃ,Ò²¾ÍÊÇ˵£¬¶ÔÓÚmysqlÊý¾Ý¿â£¬²»±ØÏñaccess»òÕßoracleÒª½¨Á¢odbcÊý¾ÝÔ´¡£
Æä´Î£¬½«ÉÏÃæµÄ.jarÎļþ¼ÓÈëµ½classpath»·¾³±äÁ¿ÖС£
×îºó£¬¾ÍÊÇд´úÂë½øÐвâÊÔÁË¡£
Ö÷Òª´úÂëÈçÏ£º
import java.sql.*;
public class Test{
private Connection conn;
private Statement stat;
public Test()
{
try
{
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//¼ÓÔØÇý¶¯³ÌÐò
Class.forName("com.mysql.jdbc.Driver"); //¼ÓÔØÇý¶¯³ÌÐò
}
catch (Exception ex)
{
System.out.println("sql exception: driver ERROR!!!!");
ex.printStackTrace();
}
try
{
conn = DriverManager.getConnection("jdbc:mysql://10.64.10.100:3306/test","root","root");//½¨Á¢Á¬½Ó£¬
stat = conn.createStatement();//´´½¨Statement¶ÔÏó
}
catch (SQLException ex)
{
//sql exception
System.out.println("sql exception: connect or driver!!!!");
ex.printStackTrace();
}
}
Ïà¹ØÎĵµ£º
ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔÀí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
private Object data; //ÔªËر¾Éí
private NodeBean next; //ÏÂÒ»¸ö½Úµã
&n ......
Ò»¡¢Ê²Ã´ÊÇ·´É䣺
·´ÉäµÄ¸ÅÄîÊÇÓÉSmithÔÚ1982ÄêÊ×´ÎÌá³öµÄ£¬Ö÷ÒªÊÇÖ¸³ÌÐò¿ÉÒÔ·ÃÎÊ¡¢¼ì²âºÍÐÞ¸ÄËü±¾Éí״̬»òÐÐΪµÄÒ»ÖÖÄÜÁ¦¡£ÕâÒ»¸ÅÄîµÄÌá³öºÜ¿ìÒý·¢Á˼ÆËã»ú¿ÆѧÁìÓò¹ØÓÚÓ¦Ó÷´ÉäÐÔµÄÑо¿¡£ËüÊ×Ïȱ»³ÌÐòÓïÑÔµÄÉè¼ÆÁìÓòËù²ÉÓÃ,²¢ÔÚLispºÍÃæÏò¶ÔÏó·½ÃæÈ¡µÃÁ˳ɼ¨¡£ÆäÖÐLEAD/LEAD++ ¡¢Open ......
¼ÙÈçÎÒÃǵÄmysqlÓÐÒ»¸ö¼ÆÊýÆ÷£¬¶øÕâ¸ö¼ÆÊýÆ÷ÐèÒªÎÒÃÇÖØÐÂͳ¼Æ£¬Ôõô°ìÄØ£¿
Ó¦Óó¡¾°£¬±ÈÈç˵ÓÐÒ»¸öÉ̳¡£¬Ã¿ÂôÒ»¸ö²úÆ·¶¼²úÉúÒ»¸öÁ÷Ë®£¬È»ºóÎÒÃÇÐèÒªÖªµÀÿ±ÊÁ÷Ë®ÊǸòúÆ·µÚ¼¸´Î³öÊ۵ģ¬ÕâÑù˵¿ÉÄܲ»Ã÷°×£¬ÎÒÄÃÒ»¸öÏêϸµÄÊý¾Ý
¾ÙÀý°É¡£
recordID,productID,productType,sellDate,counter
1, 1, 1, '2010-1-15 15:20:10 ......
Èç¹ûÄãÓõÄÊÇmyeclipse 6.0 ¶øÇÒ ÔÚʹÓÃ
@Override ʱ³öÏÖÒÔÏ´íÎó£º
The method XXXXXX of type XXXXXXXXX must
override a superclass method
ÄÇÊÇÒòΪÄãµÄCompiler ÊÇjdk1.5£¬Ö»Òª°ÑËü¸ÄΪ 1.6¾Í¿ÉÒÔÁË
·½·¨£º
1. window ->preferences... -> java -> Compiler
2. Compiler compliance lev ......
Ò».±àд¹¹ÔìÆ÷µÄÓÐЧ׼Ôò£º Óþ¡¿ÉÄܼòµ¥µÄ·½·¨Ê¹¶ÔÏó½øÈëÕý³£×´Ì¬£¬Èç¹û¿ÉÒԵĻ°£¬±ÜÃâµ÷ÓÃÆäËû·½·¨¡£ÔÚ¹¹ÔìÆ÷ÄÚΨһÄܹ»°²È«µ÷ÓõÄÄÇЩ·½·¨ÊÇ»ùÀàÖеÄfinal·½·¨£¨Ò²ÊÊÓÃÓÚprivate·½·¨£¬ËüÃÇ×Ô¶¯ÊôÓÚfinal·½·¨£©¡£ ¶þ.Óü̳нøÐÐÉè¼ÆµÄ×¼Ôò£º Óü̳бí´ïÐÐΪ¼äµÄ²îÒ ......