NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
tangara
Joined: 06 Sep 2009 Posts: 20
|
Posted: Thu Apr 19, 2012 5:08 am Post subject: What's wrong with my ODBC connection error ? |
|
|
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. |
|
| Back to top |
|
 |
jyeary
Joined: 21 Oct 2008 Posts: 605 Location: Simpsonville, SC
|
Posted: Thu Apr 19, 2012 6:37 pm Post subject: Re: What's wrong with my ODBC connection error ? |
|
|
Do you have a mySQL ODBC connection with the same name?____________________________
John Yeary
____________________________ |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|