This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 3700
    
    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: 3700
    
    5

Shouldn't be, but really we need to see the message following the SQL error in order to help.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JDBC INSERT error
 
Similar Threads
XML, flat files to database
Approach for "Say", part a
Transaction management
JSP and Access
Game on SQL