aspose file tools*
The moose likes JDBC and the fly likes mysql Connector/J prerequisites Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "mysql Connector/J prerequisites" Watch "mysql Connector/J prerequisites" New topic
Author

mysql Connector/J prerequisites

kashwini Kulkarni
Ranch Hand

Joined: Aug 07, 2009
Posts: 63
Hello,


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
Can you specify what are the Exceptions you get...and how are you trying to install the Driver


SCJP 75%
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

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.


JBoss In Action
kashwini Kulkarni
Ranch Hand

Joined: Aug 07, 2009
Posts: 63


Thanks a lot for replying.

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?


Thanking You
KAshwini

Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

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.


OCUP UML fundamental and ITIL foundation
youtube channel
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

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
Hello,

Sorry for late reply.
Thanks a Lot for the replies




Thanks in Advance
KAshwini



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mysql Connector/J prerequisites