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

  • From: "tangara" < >
  • To:
  • Subject: [nbj2ee] What's wrong with my ODBC connection error ?
  • Date: Thu, 19 Apr 2012 05:09:03 +0000

Hi forum,

I tried to use my ODBC connection in my servlet.

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


Code:

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

        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        Connection con = null;
        ResultSet rs = null;
        PreparedStatement ps = null;
        Statement stmt = null;

               try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                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.

Thanks.






[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 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close