I want to insert data into my oracle table using netbeans text fields and there is a problem with this code. When this screen execute it gives me an exception:
java.sql.SQLException:Invalid column index
Please help me as soon as possible.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
conn = javadb.ConnectDb();
try{
String sql = "insert into addbook (id, title, isbn, author)"
+ " values(null,'','','');";
pst = (OraclePreparedStatement) conn.prepareStatement(sql);
pst.setString(1, title.getText());
pst.setString(2, isbn.getText());
pst.setString(3, author.getText());
rs = (OracleResultSet) pst.executeQuery();
}catch(SQLException | HeadlessException e){
JOptionPane.showMessageDialog(null, e);
}
}