By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,842 Members | 1,608 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,842 IT Pros & Developers. It's quick & easy.

Error java.lang.NumberFormatException: For input string: ""

P: 1
Hi , I am a beginner in java ...I done some program for my lab and i am getting an error
Error java.lang.NumberFormatException: For input string: ""

My Code is

int id=Integer.parseInt(t1.getText().trim());
int q=Integer.parseInt(t3.getText());
String name=t2.getText();
int st=0;
srd.executeUpdate("INSERT INTO ORDER VALUE("+id+","+q+",0,'"+name+"')");
Feb 8 '12 #1
Share this Question
Share on Google+
1 Reply

P: 21

Kindly check ur code
1) c=DriverManager.getConnection("jdbc:odbc:srd");
here u need to give username and passward to get connection.It shouldbe like this---
c=DriverManager.getConnection("jdbc:odbc:srd","use rname","password");

2)srd.executeUpdate("INSERT INTO ORDER VALUE("+id+","+q+",0,'"+name+"')");
Instead of "value" write "values".

@devisamy 1srd
Feb 8 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.