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

  • SEARCH
  • Home
  • 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 8948855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:06:06+00:00 2026-06-15T13:06:06+00:00

I am using mysql-connector-java-5.1.22-bin.jar for JDBC in a desktop application with JAVASE 7 (which

  • 0

I am using mysql-connector-java-5.1.22-bin.jar for JDBC in a desktop application with JAVASE 7 (which is working fine) but for JAVASE 6 (with the same code as in JAVASE 7 app) its not working. neither I can see any exception in console nor any debugging prints that I made. what can be wrong?

heres my project folder http://open-pages.com/temp.zip

  • 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-15T13:06:08+00:00Added an answer on June 15, 2026 at 1:06 pm

    I don’t think your issue involves java 6 vs. Java 7. Nothing in your code is using Coin syntax as far as I read. The issue is java desktop app vs. Web application. Is the JDBC driver included in the war file? (in the library folder) I usually configure database connections in context. xml and obtain a dataSource using InitialContext.

    Just write a simple test jsp or Servlet to connect to your database and display some query results. You can just print anything exceptions right to the web page to make it easy for testing. I’m not sure why the exceptions weren’t getting written to your log file (check for the most recent files written to the log folder of your server)

    <%-- mysqlTest.jsp :For testing mysql connection and database query syntax --%>
    <html><body>
    <h2 align="center">SQL Test for mySQL JDBC Driver</h2>
    <%
    java.sql.Connection con = null;
    try {
        String url="jdbc:mysql://localhost:3306/test";
        Class.forName("com.mysql.jdbc.Driver").newInstance();
        con=java.sql.DriverManager.getConnection(url, "root", "abc");
        if(con!=null) {
            String query="select userName, password from users";
            java.sql.PreparedStatement stmt=con.prepareStatement(query);
            java.sql.ResultSet r=stmt.executeQuery();
            while(r.next()){
                out.print(r.getString(1));
                out.println("<br>");
            }
            r.close();
            stmt.close();
        }
        else
            out.println("<strong>The Database connection is null.  DriverManager could not return a valid connection.</strong>");        
        }
        catch(ClassNotFoundException e){
            out.println("Cannot load driver<br>" +e.toString());
        }
        catch(java.sql.SQLException e){
            out.println(e);
        }
        catch(Exception e){
            out.println(e);
        }
        finally {
            if(con!=null)
                con.close();
        }
    %></body></html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im having a problem with fetching data from Mysql 5.1 using JDBC (mysql-connector-java-5.1.18-bin.jar). my
I am using mysql-connector-java-5.1.18-bin.jar for database connectivity from a view. The JDBC connectivity code
Now Iam using Drizzle drizzle-jdbc-1.1 instead of mysql-connector-java-5.1.12 . But when reading data from
I'm using Mysql database and neatbeans IDE conncting by mysql-connector-java-5.1.21 jdbc , and I
I'm accessing public mySQL database using JDBC and mySQL java connector . exonCount is
I have added my mysql-connector-java-5.1.18-bin.jar to jre and jdk libs. And Here it is:
I'm using mysql-connector-java-5.1.21 and I am getting a memory leak for which Memory Analyzer
I'm trying to connect to a mysql database using Connector/J but get the same
i can connect mysql with java using eclipse in a java application with these
I am trying to connect to a MySQL Server using JDBC tool in java

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.