import java.sql.*;
class TestConnection
{
public static void main(String args[])
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:ram","myuser","myuser");
Statement st = con.createStatement();
st.executeUpdate("insert into student values( &stno, &sname, &course, &fees); ");
System.out.println("1 row Inserted");
con.close();
}
catch(Exception P)
{
P.printStackTrace();
}
}
}
我已经创建了表格,我想从键盘输入输入,但是我收到以下错误请帮助我......
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01008: not all variables bound
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
at TestConnection.main(TestConnection.java:13)