I am trying to install and use mysql Connector/J but am getting some exceptions.
Can anyone tell me what are the prerequisites for installing mysql Connector/J ?
Thanks in Advance
KAshwini
Arpit Panwar
Greenhorn
Joined: Jul 16, 2009
Posts: 12
posted
0
Can you specify what are the Exceptions you get...and how are you trying to install the Driver
Installation is simple: download the zip or tar.gz file and unpack it somewhere. That is it.
Prerequisites: you need to have a JVM and you must have access to a MySQL database.
To use it, make sure the mysql-connector-java-3.1.14-bin.jar file is in your classpath.
If you are running a standalone client (Java SE app), see the docs for the API calls you need to make to establish a connection.
If you are running a web app or other Java EE app, see the app server or web container documentation for how to set up and access a data source.
Actaully i searched the net for the installation process and got the following steps on some site ,i just followed those.
1. Extract the folder. You can put it anywhere,it does not matter.
2. Copy file 'mysql-connector-java-3.1.12-bin.jar' from the extracted folder into jdk1.5\jre\lib\ext folder.
3. Copy file 'aspectjrt.jar' from \src\lib into jdkxxx/jre/lib/ext folder.
4. Go to control Panel->Advance->Environment Variable->System Variable.
5. The next step depends on your system variable:
IF YOU HAVE CLASSPATH:
6. Click once at Classpath and then click edit.
7. At the end of the Variable Value, simply put ';C:\jdk1.5\jre\lib\ext\mysql-connector-java-3.1.12-bin.jar'.(Without the ')
8. Click OK.
I am getting following exception
CommunicationsException: Communications link failure.
Actaully I am all confused as to what could be the best and feasible backend for swing?
2. Copy file 'mysql-connector-java-3.1.12-bin.jar' from the extracted folder into jdk1.5\jre\lib\ext folder.
3. Copy file 'aspectjrt.jar' from \src\lib into jdkxxx/jre/lib/ext folder.
That is not very good advise.
Better follow the steps from MySql team.
IF YOU HAVE CLASSPATH:
6. Click once at Classpath and then click edit.
7. At the end of the Variable Value, simply put ';C:\jdk1.5\jre\lib\ext\mysql-connector-java-3.1.12-bin.jar'.(Without the ')
8. Click OK.
This is also bad advice. You should never set CLASSPATH in either the User Variables or the System Variables. I used to set CLASSPATH when I first started using Java and ran into numerous issues - I haven't had CLASSPATH set for over 10 years now. Instead, define CLASSPATH local to a bat file or sh script, or just pass it using -classpath on the command line.
kashwini Kulkarni
Ranch Hand
Joined: Aug 07, 2009
Posts: 63
posted
0
Hello,
Sorry for late reply.
Thanks a Lot for the replies