NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
irosha
Joined: 12 Sep 2011 Posts: 2
|
Posted: Mon Sep 12, 2011 5:19 pm Post subject: Too few parameters. Expected 1 |
|
|
im trying this code.but it gives this error."Too few parameters. Expected 1".pls help.
this is my code.
int id;
String name;
int age;
id = Integer.parseInt(jTextField1.getText());
name = jTextField2.getText();
age = Integer.parseInt(jTextField3.getText());
jTextField4.setText(name);
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String url = "Jdbc:odbc:db1";
Class.forName(driver);
Connection con = DriverManager.getConnection(url);
System.out.println("connected to" + con.getCatalog());
Statement st = con.createStatement();
String qq = "insert into Table1 (ID,fname,age) values("+id+",+name+","+age+")";
st.executeQuery(qq); |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|