原链接http://stackoverflow.com/questions/19105939/java-sql-sqlexception-ora-00917-missing-comma
整理如下
java.sql.SQLException: ORA-00917: missing comma
You shouldn't be trying to build your own SQL string, because you have to deal with quoting and escaping (which has bitten you here).
Instead, use a PreparedStatement
and let the JDBC API escape, quote and format (eg dates) your valuesfor you:
String query = "INSERT INTO employees VALUES (?,?,?,?,?,?,?,?,?,?,?)";
PreparedStatement ps = conn.prepareStatement(query);
ps.setInt(e.getEmployeeId(), 1);
ps.setString(e.getFirstName(), 2);
ps.setDate(e.getHireDate(), 6);
// etc - there is a setter for each basic datatype
ps.execute();
ps.close();
The coding is easier, and readability goes way up too.