This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Validate SQL Queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Validate SQL Queries" Watch "Validate SQL Queries" New topic

Validate SQL Queries

padmanabh dongre

Joined: Aug 13, 2001
Posts: 24
Is there any way I can validate the syntax of an SQL query in java without actually executing it in the database ?

kundi kx

Joined: Feb 03, 2003
Posts: 10
CHeck and see if your Database server has a SQL console you can use, and try your SQL there.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

If you are needing the syntax to be checked in your program, look into Regular Rxpressions for checking the syntax. It's how compilers work.

GenRocket - Experts at Building Test Data
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1138

Hi Padmanabh,
Asked (and answered -- by me) in this forum:
[Assumes you are using an Oracle database!]
Good Luck,
I agree. Here's the link:
subject: Validate SQL Queries
It's not a secret anymore!