By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,742 Members | 2,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,742 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;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=DriverManager.getConnection("jdbc:odbc:srd");
srd=c.createStatement();
srd.executeUpdate("INSERT INTO ORDER VALUE("+id+","+q+",0,'"+name+"')");
Feb 8 '12 #1
Share this Question
Share on Google+
1 Reply


P: 21
Hi,

Kindly check ur code
at
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.