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 7745779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:06:33+00:00 2026-06-01T10:06:33+00:00

I am connecting to a DB2 database (DB2 v9.7.400.501) from my Java web application

  • 0

I am connecting to a DB2 database (DB2 v9.7.400.501) from my Java web application using the IBM DB2 Type 4 driver (db2jcc4.jar). When I try to execute an SQL statement like this,

SELECT * FROM USERS WHERE UPPER(USERNAME) = UPPER('testuser');

I get the following exception:

com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error:
SQLCODE=-104, SQLSTATE=42601, SQLERRMC=;;=
UPPER(‘testuser’);END-OF-STATEMENT, DRIVER=4.12.55

The problem is from the UPPER function since, a normal select statement executes normally.

  • 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-01T10:06:35+00:00Added an answer on June 1, 2026 at 10:06 am

    Maybe you should use is this way:

    SELECT * FROM USERS WHERE UPPER(USERNAME) LIKE UPPER('testuser');
    

    Your code with ‘=’ is seems ok for SQLite but don’t know anbout db2.

    UPD. After some investigation, I can say that error is cause by Java code which tries to execute multiple statements in one query using ‘;’ as a delimiter.
    You should try using the PreparedStatement, addBatch() and executeBatch() for multiple statements.

    UPD2. This is DB2 related issue. PostgreSQL, afaik, allows multiple statements in single query.

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

Sidebar

Related Questions

I need to access DB2 database in plain standalone Java project. I cannot use
I would like to connect to a DB2 database, specifically an iSeries version, using
I have a simple Java app that suddenly stopped connecting to a local DB2
I am using command db2 restore db S18 from /users/intadm/s18backup/ taken at 20110913113341 on
OK long story short, we designed and built a web application connecting to a
I create a custom schema in my DB2 database using the following command: db2
I've been assigned to develop a small Java application to process some data from
A hobby project of mine is a Java web application. It's a simple web
doing profiling on an java application running websphere 7 and DB2 we can see
I'm trying to fill a asp.DataGrid with data from a DB2 database. The problem

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.