Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC INSERT error

 
J chan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4010
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the SQL Exception exactly?
 
J chan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4010
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shouldn't be, but really we need to see the message following the SQL error in order to help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic