Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8799657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:22:58+00:00 2026-06-14T00:22:58+00:00

I try to execute the following SQL-Statement (in my Java-application): SELECT * FROM Tbl_Job

  • 0

I try to execute the following SQL-Statement (in my Java-application):

SELECT * FROM Tbl_Job WHERE jobname LIKE '%aa%';

But I can’t get the same (correct?) result using MS Access (2002):

SELECT * FROM Tbl_Job WHERE jobname LIKE '*aa*';

With this example Access will give me 400 datasets and my Java-application will only give me somewhat less I don’t know the exact number of datasets.

I tried to use the [*]-wildcard in my Java-app but it didn’t give me any datasets at all.
Besides I tried to replace the [‘]-character with the [“]-character but this didn’t work either.

I don’t know whether this is relevant or not but I think the *.mdb-file was created with MS Access (2000)

My Java code:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connection = DriverManager.getConnection("jdbc:odbc:_
                        Driver={Microsoft Access Driver_
                        (*.mdb)};DBQ=C:\database.mdb");
Statement stm = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stm.executeQuery(sql);
while(rs.next())
    do_some_stuff();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:22:59+00:00Added an answer on June 14, 2026 at 12:22 am

    Suggest you try this SQL statement both from Java and directly in Access.

    SELECT Count(*) AS num_rows FROM Tbl_Job WHERE jobname ALike '%aa%';
    

    If num_rows is the same in both cases, change the WHERE clause in your first query to match this one.

    If num_rows is not the same in both cases, please describe how they differ and which is correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting the following error when I try to execute the sql statement below
I get the following error when I try and execute the code down below.
When I try to execute this statement in Oracle SQL Developer 2.1 a dialog
I can compile but can't execute the following code with the error (using Postgres):
I get the following exception, java.sql.SQLSyntaxErrorException: Syntax error: Encountered 80 at line 1, column
I'm trying to execute the following SQL statement (built and tested in SQL Server
If I try to execute the following code, I get the errors Msg 207,
Hello I try to create a function to generate select functions. But the following
I have a SQL Statement that works as I want. select COUNT(*), MIN(emailed_to)from email.email_archive
I get the error below when I try to execute a task with celery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.