Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java.jar and Mysql.jar

  1. #1
    Member
    Join Date
    Nov 2010
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java.jar and Mysql.jar

    Hi all

    Right I currently have a two servers, one holding a database, and one with files stored.
    I have created a file which gets all the files stored on the second and inserts it into the database.
    Using the IP address of the first to tell the system that this is the host.

               url = "jdbc:mysql://192.168.1.10/" + database;
               conn = DriverManager.getConnection(url, user, password);

    When i try and run this, the server cannot locate the mysql driver.
    with netbean i selected the option to create a jar with specified libs included.

    I have also tried adding the driver to the java/lib folder on the second server and this didnt work.

    My question is, Is there a way i can point explicitly, to the mysql driver file from the java class?
    or combine the Jar files together so they work with each other.

    Thanks
    Kurt

  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,099
    Thanks
    169
    Thanked 779 Times in 725 Posts
    Blog Entries
    5

    Default Re: Java.jar and Mysql.jar

    You need to place the jar on your classpath. If you package the jar's together, you need to make sure the manifest file reflects the class path (see Modifying the Manifest). Otherwise, your server may have a default directory to place jar's that, once in that directory are inherently on the classpath.

Similar Threads

  1. [SOLVED] i cant make a java jar file which can search data from mysql
    By talha07 in forum JDBC & Databases
    Replies: 6
    Last Post: January 20th, 2011, 05:09 AM
  2. Java Applet and MySQL
    By Terillius in forum JDBC & Databases
    Replies: 4
    Last Post: August 21st, 2010, 10:05 PM
  3. MySQL Database
    By pjeremy90 in forum Java Theory & Questions
    Replies: 2
    Last Post: June 12th, 2010, 10:34 AM
  4. Connectivity problem:MySQL and Java
    By Pragya in forum JDBC & Databases
    Replies: 2
    Last Post: January 22nd, 2010, 02:58 AM
  5. Use of Unicode 5.1 in MySQL DB with Java
    By Desert Fox in forum JDBC & Databases
    Replies: 2
    Last Post: November 12th, 2008, 07:29 AM