I have a problem - I get an error message:
"java.sql.SQLException: Column 'cod_pro'nod found."
Why does this "column not found" error come out?
This is my code:
void generarNumeroFactura(){
String sql ="SELECT LAST_INSERT_ID(cod_pro)+1 FROM tickets";
Conectar cc= new Conectar();
Connection cn = cc.conexion();
try {
java.sql.Statement st = cn.createStatement();
ResultSet rs = st.executeQuery(sql);
while(rs.next()){
//Aca le digo que muestre el valor en un JtextFiel
txtcod1.setText(rs.getString("cod_pro"));
}
} catch (Exception e) {
// NOTA: So hubo error muestra el error
JOptionPane.showMessageDialog(null, e);
}