Solved

wildcards in executequery

Posted on 1998-04-18
1
296 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 200 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now