Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

wildcards in executequery

Posted on 1998-04-18
1
Medium Priority
?
305 Views
Last Modified: 2010-04-16
I'm using wildcards in querys, for example:

executeQuery("select * from table artikel where artikelname like '*baseball*'")

I've tested the query directly with a MS-Access-Database and everything works fine. From within java I get no columns
with my resultset. For testing I tried without wildcards

executeQuery("select * from table artikel where artikelname like 'baseball'")

and it works.
0
Comment
Question by:felgen
1 Comment
 

Accepted Solution

by:
sdaxm11 earned 600 total points
ID: 1219050
well, you have to use the % sign not the * sign example

executeQuery("select * from table artikel where artikelname like '%baseball%'")


this is because you are using the JDBC API's and not sending the SQL command directly to MS Access.  you are using JBDC-ODBC which translate it to Access command.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question