Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8359087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:01:47+00:00 2026-06-09T11:01:47+00:00

I have a Java program which does CRUD on a MySQL database. For this,

  • 0

I have a Java program which does CRUD on a MySQL database.

For this, I had been using :

Eclipse Indigo
Java 1.6
MySql-Connector-java-5.1.19-bin.jar

I tried executing the same code on a new machine with :

Eclipse Juno
Java 1.7
MySql-Connector-java-5.1.19-bin.jar. 

I’ve added the MySql connector to the Build Path of the project in Eclipse Juno.

However, the ant build fails with errors about about missing classes and packages which should be picked up from the connector :

Buildfile: /home/rudra/Softwares/openfire/openfire_src/build/build.xml
init:
compile:
[javac] Compiling 14 source files to /home/rudra/Softwares/openfire/openfire_src/work/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:3: error: package com.mysql.jdbc does not exist
[javac] import com.mysql.jdbc.Connection;
[javac]                      ^
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:4: error: package com.mysql.jdbc does not exist
[javac] import com.mysql.jdbc.PreparedStatement;
[javac]                      ^
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:5: error: package com.mysql.jdbc does not exist
[javac] import com.mysql.jdbc.ResultSet;
[javac]                      ^
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:21: error: cannot find symbol
[javac]             PreparedStatement stat = (PreparedStatement)connect.prepareStatement(query2);
[javac]             ^
[javac]   symbol:   class PreparedStatement
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:21: error: cannot find symbol
[javac]             PreparedStatement stat = (PreparedStatement)connect.prepareStatement(query2);
[javac]                                       ^
[javac]   symbol:   class PreparedStatement
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:21: error: cannot find symbol
[javac]             PreparedStatement stat = (PreparedStatement)connect.prepareStatement(query2);
[javac]                                                                ^
[javac]   symbol:   method prepareStatement(String)
[javac]   location: variable connect of type Connection
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:23: error: cannot find symbol
[javac]             ResultSet result = (ResultSet) stat.executeQuery();
[javac]             ^
[javac]   symbol:   class ResultSet
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:23: error: cannot find symbol
[javac]             ResultSet result = (ResultSet) stat.executeQuery();
[javac]                                 ^
[javac]   symbol:   class ResultSet
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:28: error: cannot find symbol
[javac]                 PreparedStatement preparedStmt = (PreparedStatement) connect.prepareStatement(query);
[javac]                 ^
[javac]   symbol:   class PreparedStatement
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:28: error: cannot find symbol
[javac]                 PreparedStatement preparedStmt = (PreparedStatement) connect.prepareStatement(query);
[javac]                                                   ^
[javac]   symbol:   class PreparedStatement
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:28: error: cannot find symbol
[javac]                 PreparedStatement preparedStmt = (PreparedStatement) connect.prepareStatement(query);
[javac]                                                                             ^
[javac]   symbol:   method prepareStatement(String)
[javac]   location: variable connect of type Connection
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:41: error: cannot find symbol
[javac]                 PreparedStatement statement = (PreparedStatement) connect.prepareStatement("Insert into user values (?,?,?);");
[javac]                 ^
[javac]   symbol:   class PreparedStatement
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:41: error: cannot find symbol
[javac]                 PreparedStatement statement = (PreparedStatement) connect.prepareStatement("Insert into user values (?,?,?);");
[javac]                                                ^
[javac]   symbol:   class PreparedStatement
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:41: error: cannot find symbol
[javac]                 PreparedStatement statement = (PreparedStatement) connect.prepareStatement("Insert into user values (?,?,?);");
[javac]                                                                          ^
[javac]   symbol:   method prepareStatement(String)
[javac]   location: variable connect of type Connection
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:73: error: cannot find symbol
[javac]             PreparedStatement statement = (PreparedStatement) connect.prepareStatement(query);
[javac]             ^
[javac]   symbol:   class PreparedStatement
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:73: error: cannot find symbol
[javac]             PreparedStatement statement = (PreparedStatement) connect.prepareStatement(query);
[javac]                                            ^
[javac]   symbol:   class PreparedStatement
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:73: error: cannot find symbol
[javac]             PreparedStatement statement = (PreparedStatement) connect.prepareStatement(query);
[javac]                                                                      ^
[javac]   symbol:   method prepareStatement(String)
[javac]   location: variable connect of type Connection
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:75: error: cannot find symbol
[javac]             ResultSet result = (ResultSet) statement.executeQuery();
[javac]             ^
[javac]   symbol:   class ResultSet
[javac]   location: class UserDB
[javac] /home/rudra/Softwares/openfire/openfire_src/src/java/org/jivesoftware/openfire/UserDB.java:75: error: cannot find symbol
[javac]             ResultSet result = (ResultSet) statement.executeQuery();
[javac]                                 ^
[javac]   symbol:   class ResultSet
[javac]   location: class UserDB

Can anyone help me with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:01:49+00:00Added an answer on June 9, 2026 at 11:01 am

    Taking a cue from this question :

    Assuming that you have a compile target in your build.xml which looks similar to this :

    <!-- Compile application -->
      <target name="compile">
        <mkdir dir="${classes.dir}"/>
        <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="yes" includeantruntime="false">
          <classpath refid="classpath" />
        </javac>
      </target>
    

    All we need for successful compilation is to define the classpath so that it includes all the jars in the lib directory of the project, like so :

      <path id="classpath">
        <fileset dir="${lib.dir}" includes="*.jar"/>
      </path>
    

    I understand from your question that you have added a reference to the connector jar inside the Eclipse project. You could try the above suggestion after copying the connector jar inside the Eclipse project’s lib folder.

    Alternatively, though not a great suggestion in my opinion, you could export the project as an Ant Build and check the build.xml thus generated. This can be done by going to File -> Export, typing ‘ant’ to filter and then choosing ‘Ant Buildfiles’, like so :

    Export as Ant BuildFiles

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program which I wrote in Java using Eclipse and then put
I have a Java program which is using WMIC to get certain information about
I have java API which return this type: ArrayList[ArrayList[String]] = Foo.someJavaMethod() In scala program,
I have a Java program using AWT which I would like to run on
Suppose that I have a Java program within an IDE (Eclipse in this case).
I have a java program which does individual jobs e.g. takes in a file,
I have a java program which sends a udp packet to a server when
I have a Java program which prepares data into a fairly complex and big
I have a Java 3D program which uses lots (hundreds) of 3D models (3ds
I have a Java program in which an action is initiated which loops through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.