在java应用程序中,mysql驱动只要放到工具的jre/lib/ext/下即可,而web程序还要加到web程序的webroot/web-inf/lib下才可以用
连接mysql代码:
Class.forName("com.mysql.jdbc.Driver");//驱动的名
Connection c=DriverManager.getConnection("jdbc:mysql://localhost/数据库名?user=用户名&password=密码");
//访问的数据库的帐号密
Statement s=c.createStatement();
然后就是增删改查了
连接mysql代码:
Class.forName("com.mysql.jdbc.Driver");//驱动的名
Connection c=DriverManager.getConnection("jdbc:mysql://localhost/数据库名?user=用户名&password=密码");
//访问的数据库的帐号密
Statement s=c.createStatement();
然后就是增删改查了