wood burning stoves*
The moose likes JDBC and the fly likes SQL Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Exception" Watch "SQL Exception" New topic
Author

SQL Exception

shuzo monsoon
Ranch Hand

Joined: Feb 11, 2004
Posts: 54
Hello all. I can't figure out what is goin wrong with an INSERT SQL query I am using in a JSP page. Here is the code -

But when I attempt to execute this query, I get an SQLException error saying : Syntax error in INSERT INTO statement.
I have also tried using a prepared statement but I get the same error.
Can anyone help?
Thanks!
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

Numerical data should not be wrapped in ' '.
fox tie
Greenhorn

Joined: Mar 29, 2004
Posts: 7
sometimes you must add database name before the table's name between a dot.
for example: book.order
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

sometimes you must add database name before the table's name between a dot.

Though this is clearly not one of those times.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jon Egan
Ranch Hand

Joined: Mar 24, 2004
Posts: 83
Are there other inserts working for this table? possible that the table name itself is causing the problem, since ORDER is [part of] an ANSI SQL keyword (ORDER BY)?
I remember one time I was working with a field which held a description, and we were getting errors until we renamed it to "descr" instead of "desc" :roll:
Hope this is the problem, because it seems like it would be simple to fix...
-- Jon
Drew Dambrell
Greenhorn

Joined: Mar 31, 2004
Posts: 6
you could use PL/SQL worksheet or someother interface app to test your query b4 you actually add it in your code
or something along those lines
[ March 31, 2004: Message edited by: Dru InHeaven() ]

Pimpin tha code, one servlet @ a time
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL Exception