Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Like statement Using JDBC:ODBC

 
Mathias Nilsson
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers!
I have a problem. I'm using JDBC DBC to connect to a MS ACCESS 2000 database. When I run the query in MS ACCESS I get correct results. When I
run it in the javacode I get an empty resultset. I Don�t have any problem with select , update , delete statements that doesn't use "LIKE".
Here is an example.
SELECT * FROM Customers WHERE Name LIKE '*Sun*'. This works fine when I
run it as a Query in MS ACCESS 2000. When I run it in the javacode I get no result.
Normally when using LIKE the * character should be replaced with the %character
SELECT * FROM Customers WHERE Name LIKE '%Sun%'
But not with MS ACCESS? Can anyone help me with like statements using MS
ACCESS 2000?
// Mathias
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mathias,
Works for me on Windows XP with Microsoft Access 2002 and J2SE 1.4.2_02
You've probably made a mistake somewhere in your code -- but I'm afraid I couldn't see any of your code in your post. Perhaps if you'd care to post your code, I may be able to help further.
Good Luck,
Avi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic