aspose file tools*
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 Spring in Action this week in the Spring 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
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    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
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

Shouldn't be, but really we need to see the message following the SQL error in order to help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC INSERT error