使用JDBC连接MySql
2006-10-31 23:52
295 查看
第一步:下载JDK5。0,MySQL,安装配置完毕
第二步: 下载mysql-connector-java-5.0.3-bin,from www.mysql.com
d第三步:将mysql-connector-java-5.0.3-bin分别拷贝至C://program files/jre1.5.0_09/lib/ext和D://program files/jdk1.5.0_09/jre/lib/ext/
第四步:编写测试程序,代码如下:
import java.sql.*;
public class DBTest {
public static void main(String[] args) {
try {
// The newInstance() call is a work around for some
// broken Java implementations
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception ex) {
System.out.println("It's wrong!");
}
}
}
嘎嘎,大功初告成!
第二步: 下载mysql-connector-java-5.0.3-bin,from www.mysql.com
d第三步:将mysql-connector-java-5.0.3-bin分别拷贝至C://program files/jre1.5.0_09/lib/ext和D://program files/jdk1.5.0_09/jre/lib/ext/
第四步:编写测试程序,代码如下:
import java.sql.*;
public class DBTest {
public static void main(String[] args) {
try {
// The newInstance() call is a work around for some
// broken Java implementations
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception ex) {
System.out.println("It's wrong!");
}
}
}
嘎嘎,大功初告成!
相关文章推荐
- Java使用JDBC连接随意类型数据库(mysql oracle。。)
- 使用JDBC连接Mysql的3种方式
- 如何使用三层框架开发 JDBC 连接 Mysql 数据库
- Eclipse 使用 jdbc 连接 mysql
- Java使用JDBC连接mysql、sqlserver、orcle数据库的baseDao类
- JAVA使用JDBC连接MySQl
- 使用JDBC连接MySql时出现:The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration
- 使用jdbc连接mysql 出现 java.sql.Exception: this specifer does...(root@'%')..doesn't exist.
- 使用powerdesigner连接数据库时出现Non SQL Error : Could not load class com.mysql.jdbc.Drive
- 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')
- java使用JDBC连接mysql并且进行批量增删改操作
- 【MySQL】使用JDBC时,无法连接远程MySQL数据库
- 使用连接mysql的jdbc驱动最新版引发的问题
- 使用连接mysql的jdbc驱动最新版引发的问题
- 使用powerdesigner连接数据库时出现Non SQL Error : Could not load class com.mysql.jdbc.Drive
- 利用JDBC连接MySQL并使用MySQL
- JDBC连接数据库速查(Oracle8/8i/9i,DB2,MySQL各种数据库使用JDBC连接的方式)
- 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')
- 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')
- JAVA中使用JDBC连接MySQL