• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validate SQL Queries

 
padmanabh dongre
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Is there any way I can validate the syntax of an SQL query in java without actually executing it in the database ?

Regards,
Padmanabh
 
kundi kx
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CHeck and see if your Database server has a SQL console you can use, and try your SQL there.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Padmanabh,
Asked (and answered -- by me) in this forum:
[Assumes you are using an Oracle database!]
http://www.coderanch.com/t/298353/JDBC/java/Compiling-SQL-statement-before-execute
Good Luck,
Avi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic