wood burning stoves 2.0*
The moose likes JDBC and the fly likes Problem with Access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem with Access" Watch "Problem with Access" New topic

Problem with Access

Timothy Marks

Joined: Sep 08, 2003
Posts: 4
I am having a problem with Access and seem to be able to make no progress. Maybe someone can help.
When I execute the following sql query in Access, it returns (in my DB) 3 rows:
Select Project.* from Customer INNER JOIN Project ON Customer.ID = Project.Cust_ID WHERE ((Cust.Name) Like "*Abc*");
When I try the same query with Java, I get an SQLException. I don't know what it would say in English, but something about 1 parameter expected but too few are given.
When I change the " to ', it executes without an exception, but returns 0 rows.
When I change Like to =, it works fine.
Does anyone have any idea what the problem could be?
[ September 08, 2003: Message edited by: Timothy Marks ]
Timothy Marks

Joined: Sep 08, 2003
Posts: 4
Solved it. Seems that in Access,

Is legal and returns the expected rows, but if you are accessing the data programmatically, you must

Just another useless inconsistency that makes everything Billy does so darned difficult
It is sorta covered in the JavaRanch Style Guide.
subject: Problem with Access
Similar Threads
SQL subquery performs too slowly
Delayed result with 'not like' clause in Where clause
Need help with Jave Oracle Connection
ResultSet check...
Connection object giving resultset which doesnot match with query when run in anlyzer