wood burning stoves 2.0*
The moose likes JDBC and the fly likes JDBC INSERT error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC INSERT error" Watch "JDBC INSERT error" New topic
Author

JDBC INSERT error

J chan
Greenhorn

Joined: Jul 16, 2006
Posts: 2
please help

the following code block is giving an sql exception. I have checked through it several times will no success.


PreparedStatement stat = con.prepareStatement("Insert into STUDENT_T values(?,?)");
stat.setInt(1,Integer.parseInt(txtId.getText()));
stat.setString(2,txtName.getText());

thanks in advance

JCHAN
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703
    
    5

What is the SQL Exception exactly?


My Blog: Down Home Country Coding with Scott Selikoff
J chan
Greenhorn

Joined: Jul 16, 2006
Posts: 2
Hi Thanks, i got that matter verrified. i belive there was an sql error
i am not very sure what really was the error but i just wrote back again
the same sql query using capital letters as the fields of the tables were created in capital.

is that sql query case sensitive.

thanks for ur time
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703
    
    5

Shouldn't be, but really we need to see the message following the SQL error in order to help.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JDBC INSERT error
 
Similar Threads
Game on SQL
XML, flat files to database
Approach for "Say", part a
Transaction management
JSP and Access