File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem with Access" Watch "Problem with Access" New topic
Author

Problem with Access

Timothy Marks
Greenhorn

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
Greenhorn

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Access
 
Similar Threads
Delayed result with 'not like' clause in Where clause
ResultSet check...
Connection object giving resultset which doesnot match with query when run in anlyzer
Need help with Jave Oracle Connection
SQL subquery performs too slowly