This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft 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 Java 8 in Action this week in the Java 8 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: 3697
    
    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: 3697
    
    5

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