jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes Like Operator with MS Access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Like Operator with MS Access" Watch "Like Operator with MS Access" New topic
Author

Like Operator with MS Access

Kel Walker
Greenhorn

Joined: Apr 04, 2002
Posts: 19
Is it just me or does the like operator not work with the sun.jdbc.odbc.JdbcOdbcDriver.
String sql = "SELECT * FROM test WHERE name like '*wal*' order by name;";
When this is executed in my java code no results are returned. When executed directly within Access the correct results are displayed.
Anyone else experienced the same problem. Does anyone have a like operation that works via jdbc?
Thanks.
Kel Walker
Greenhorn

Joined: Apr 04, 2002
Posts: 19
Sorry folks,
I figured it out. Although * is the MS Access wildcard the jdbc driver expects % not *.
Michael Matola
whippersnapper
Ranch Hand

Joined: Mar 25, 2001
Posts: 1746
    
    2
I just deleted a post seconds ago in which I said "wildcards in SQL are % and _". Deleted it because I looked up wildcards in Access help and saw that Access does use * and ?. (Go figure.) Good that you solved the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Like Operator with MS Access
 
Similar Threads
Compiler vs. Runtime Error
who can xplain these???
instanceof behaviour
JNDI Issue with QuartzListener Job call
Problem with Like statement Using JDBC:ODBC