[nbj2ee] Re: What's wrong with my ODBC connection error ?

  • From: John Yeary < >
  • To:
  • Subject: [nbj2ee] Re: What's wrong with my ODBC connection error ?
  • Date: Thu, 19 Apr 2012 14:14:55 -0400

Do you have a mySQL ODBC connection with the same name?

John Yeary
NetBeans Dream Team
President Greenville Java Users Group
Java Users Groups Community Leader
Java Enterprise Community Leader



"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the gray twilight that knows not victory nor defeat."
-- Theodore Roosevelt

On Thu, Apr 19, 2012 at 1:09 AM, tangara < "> > wrote:
Hi forum,

I tried to use my ODBC connection in my servlet.

It works on a servlet but just wouldn't budge in another.


protected void doGet (HttpServletRequest request, HttpServletResponse response)
           throws ServletException, IOException {

       PrintWriter out = response.getWriter();
       Connection con = null;
       ResultSet rs = null;
       PreparedStatement ps = null;
       Statement stmt = null;

              try {
               con = DriverManager.getConnection("jdbc:odbc:practicalODBC1");
            ArrayList students = new ArrayList();

The error message is :

incompatible types
required: com.mysql.jdbc.Connection
found : java.sql.Connection

The database I'm using is MSaccess and I have done the necessary configuration at the Administration control panel.

Hope somebody can advise me why.


[nbj2ee] What's wrong with my ODBC connection error ?

tangara 04/19/2012

[nbj2ee] Re: What's wrong with my ODBC connection error ?

John Yeary 04/19/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 25 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20150226.965aeb8). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
Please Confirm