This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes JAR file of JDBC connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JAR file of JDBC connection" Watch "JAR file of JDBC connection" New topic
Author

JAR file of JDBC connection

Shiva Mohan
Ranch Hand

Joined: Jan 05, 2006
Posts: 477
I have created an J2SE application which retrieves data's from mysql via JDBC driver. then I export all of the table data's to DAT file. This project works very well in my development PC which has jre and jdk installed. I need to deploy this application to client pc. I have created a jar file with mysql-connector-java-bin.jar added. When i run this on another machine the dat file is empty. I think as I donot have connection with database on another machine. please enlighten me on this topic as I am very new to deployment.

Thanks for your help in advance!!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

That is correct. When you connect to the database, you need to tell the driver where to find the database. One way is to pass the IP in the code.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JAR file of JDBC connection
 
Similar Threads
AccessControlException using custom ClassLoader with WebStart
AccessControlException with a custom ClassLoader
Jars and magic problems
Hot Spot JVM Crashes Urgent pls help
JDBC and Linux