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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:45:49+00:00 2026-06-10T05:45:49+00:00

In Java I would want to print out the query that is going to

  • 0

In Java I would want to print out the query that is going to be submitted/queried on the database so that I can see whats the error when the query throws out exception.

It will be useful to exactly locate the issue instead of trying to understand Oracle Exception ID’s and trying to match where exactly did it fail in the code. Any help please.

PreparedStatement ps = conn.prepareStatement("SELECT * FROM EMPLOYEES where EMPNAME=?");
ps.setString(1, "HULK");
ps.executeQuery();

Ideally I want to do a syso(ps) or syso(ps.getquery) and the output should be

SELECT * FROM EMPLOYEES WHERE EMPNAME='HULK'
or
SELECT * FROM EMPLOYEES WHERE EMPNAME=<HASHCODE OF THE OBJECT YOU ARE TRYING TO BIND>

  • 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-10T05:45:50+00:00Added an answer on June 10, 2026 at 5:45 am

    Something interesting I ran across, Log4JDBC, which allows you to log SQL Calls. I haven’t had a chance to use it yet, but I thought it was a great idea to be able to change the logging level and get the SQL calls into a log file.

    This is more than you asked for, but I thought it might be worth throwing out there.

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

Sidebar

Related Questions

I want to make a java class that would print out: The product of
For debug purpose, I want to print out current executing function name in Java.
What I want to do is print out every URL that is loaded within
I have some java code that will print out html from a website of
How would you implement a capacity-limited, generic MruList in C# or Java? I want
Take the following Java string: Hello, World I want to take that string and
You would think that launching a bat file from Java would be an easy
In java i would like to read a file line by line and print
I have a SQL database that contains a field. I can get all of
Although the java.net.Socket and java.net.ServetSocket give me powerful networking capabilities I wouldn't want to

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.