This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JDBC and the fly likes Using PreparedStatement Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Using PreparedStatement" Watch "Using PreparedStatement" New topic
Author

Using PreparedStatement

Tim Francisco
Greenhorn

Joined: Apr 03, 2010
Posts: 12
Hello,
Not sure what I am missing here but its driving me crazy. Its a simple PreparedStatement test program I am trying to test that I keeps failing. Here're the codes:


The exception is


I would appreciate if someone could help me figure out what's not right here.
Thanks.
T
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2350

What if you try: stmt.executeUpdate();


OCUP UML fundamental
ITIL foundation
kv ruby
Ranch Hand

Joined: Jul 23, 2009
Posts: 38
can you check the data type of value in DB?
if it is not integr then you will have to insert values in single quotes.


Regards, ruby kv
rubyshiv.blogspot.com
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Using PreparedStatement
 
Similar Threads
Syntax error while inserting a file into Mysql database.
MySQLSyntaxErrorException
"main" java.sql.SQLException: Access denied for user 'root'@'192.168.1.1' (using password: YES)
Error while using DriverManager to connect to MySQL DB.
SQL formatting question