Install the JDBC:MySQL driver
2004-11-08 09:52
519 查看
Once you have un-archived the distribution archive, you can install the driver in one of two ways:
Either copy the "com" and "org" subdirectories and all of their contents to anywhere you like, and put the directory holding the "com" and "org" subdirectories in your classpath,
or put mysql-connector-java-[version]-bin.jar in your classpath,
either by adding the FULL path to it to your CLASSPATH enviornment variable,
orby copying the .jar file to $JAVA_HOME/jre/lib/ext(this way is useful).
If you are going to use the driver with the JDBC DriverManager, you would use "com.mysql.jdbc.Driver" as the class that implements java.sql.Driver.
and the following is a test program :
TestMysql.java
when run this program
1. can't access "com.mysql.jdbc.Driver",
solution: copy the. jar file to $JAVA_HOME/jre/lib/ext
2. connection problem
my Mysql have pwd.
change
DriverManager.getConnection( url, "", " );
to
DriverManager.getConnection( url, "root", "yyp" );
------
can also refer: http://www.cs.wcupa.edu/~rkline/mysql-java-win.php
Either copy the "com" and "org" subdirectories and all of their contents to anywhere you like, and put the directory holding the "com" and "org" subdirectories in your classpath,
or put mysql-connector-java-[version]-bin.jar in your classpath,
either by adding the FULL path to it to your CLASSPATH enviornment variable,
orby copying the .jar file to $JAVA_HOME/jre/lib/ext(this way is useful).
If you are going to use the driver with the JDBC DriverManager, you would use "com.mysql.jdbc.Driver" as the class that implements java.sql.Driver.
and the following is a test program :
TestMysql.java
when run this program
1. can't access "com.mysql.jdbc.Driver",
solution: copy the. jar file to $JAVA_HOME/jre/lib/ext
2. connection problem
my Mysql have pwd.
change
DriverManager.getConnection( url, "", " );
to
DriverManager.getConnection( url, "root", "yyp" );
------
can also refer: http://www.cs.wcupa.edu/~rkline/mysql-java-win.php
相关文章推荐
- No connection properties specified - the user must supply JDBC connections 的解决办法
- eclipse安装maven3.*,提示“Cannot complete the install because one or more required items could not
- 在线安装maven插件问题:Cannot complete the install because one or more required items could not be found.
- maven--Cannot complete the install because one or more required items could not be found
- How can I install the Google Apps Package (Play Store, ...) on my Android device?
- MySQL免安装版报错:Install/Remove of the Service Denied!
- The way to Install qemu and kvm (qemu-kvm) in suse 11
- Use the Automated Installer (AI) to install the Oracle Solaris 11
- TypeException:JDBC requires that the JdbcType must be specified for all nullable parameters.
- iOS_MonkeyTalk(2)_Install the MonkeyTalk IDE
- Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb
- JDBC产生The declared package does not match the expected package
- ImportError: No module named _tkinter, please install the python-tk package ubuntu运行tkinter错误
- To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
- install mysql on the linux
- Enhancing the Application: Advanced JDBC Features(转)
- How To Install and Use the Web Application Stress (WAS) Tool
- mysqld install报错:Install/Remove of the Service Denied
- HOWTO: Boot & Install Ubuntu from the Grub Rescue Prompt
- SPRING IN ACTION 第4版笔记-第十章Hitting the database with spring and jdbc-003-四种方式获取DataSource