Servlet SQL INSERT error
Hi,
I have the following error when trying to insert ino an oracle database. The server Im using is TomCat.
SQLException: ORA-00917: missing comma
This is my code:
public boolean registeruser(String Fname, String Lname, String Email, String Username, String Password, int Mark1, int Mark2, int Mark3, int Average, double Session) throws IOException, SQLException, ClassNotFoundException{
Connection conn;
String theVerifiedRegistration = "insert into students VALUES('"+Fname+"', '"+Lname+"', '"+Email+"', '"+Username+"', '"+Password+"', '"+Mark1+"', '"+Mark2+"', '"+Mark3+"', '"+Average+"', '"+Session+"')";
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@studsol01:1521:studb2","moleary","technet");
Statement stmt;
stmt = conn.createStatement();
ResultSet rset;
rset = stmt.executeQuery(theVerifiedRegistration);
rset.next();
String theUsername = rset.getString(1);
conn.close();
I presume the critical line is :
String theVerifiedRegistration = "insert into students VALUES('"+Fname+"', '"+Lname+"', '"+Email+"', '"+Username+"', '"+Password+"', '"+Mark1+"', '"+Mark2+"', '"+Mark3+"', '"+Average+"', '"+Session+"')";
Any assistance would be appreciated.

