• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Driver does not support this function..

 
Duane Riech
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, I've already searched the forum for an answer and didn't find
anything that really seemed to answer it.
I'm using MS Access on Win 2000. I'm trying to access data that's already
in the table and when I run it, I get:
before resultset...
Exception occured...Driver does not support this function
java.sql.SQLException: Driver does not support this function
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String CbDb_url = "jdbc dbc river={Microsoft Access Driver" +
" (*.mdb)};DBQ=" +
"C:\\Project\\ODBC\\PartsBook\\PartsBook.mdb";
Connection con = DriverManager.getConnection(CbDb_url);
String sql = "SELECT * FROM PartsBook.PartsCategory";
PreparedStatement pstmt = con.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery( sql );

It fails on the executeQuery().
Based on other questions in this forum, I tried a
Statement statement con.createStatement() then
statement.executeQuery(sql), but that doesn't work either...
Can anyone tell me what I'm doing wrong?
Thanks...
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried running the query directly against Access? I'm guessing you just need "SELECT * FROM PartsCategory", but that's a pretty uneducated guess. I try not to use Access anymore.
 
Duane Riech
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was the first thing I tried.
I have another little java program that populates the table with a
INSERT statement and it works fine. I guess my question is "Does MS Access"
support SQL statements?
Also, how do you query against the MS Access db using SQL. I was not aware
that you could. I have used a query via the Wizard, but not SQL.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have another little java program that populates the table with a
INSERT statement and it works fine. I guess my question is "Does MS Access"
support SQL statements?
Yes it does. The INSERT statement was SQL, wasn't it?
Also, how do you query against the MS Access db using SQL. I was not aware that you could. I have used a query via the Wizard, but not SQL.

The code you posted looks fine from a Java point of view. What I don't know is whether the "jdbcdbc:..." string you have is correct. I'll let someone who has actually done something with Access comment on that.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic