Que tal no me funciona el siguiente codigo
class Act implements ActionListener{
public void actionPerformed(ActionEvent a){
// String nombre=((JButton)e.getSource()).getText();
// txt.setText(nombre);
try {
// Register JDBC/ODBC Driver in jdbc DriverManager
// On some platforms with some java VMs, newInstance() is necessary...
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newI nstance();
// Test with MS Access database (rjdemo ODBC data source)
String url = "jdbc:odbc:bd1";
java.sql.Connection c = DriverManager.getConnection(url);
java.sql.Statement st = c.createStatement();
String busqueda=txt.getText();
// String busqueda2=txt1.getText();
bus=Integer.parseInt(busqueda);
st.executeUpdate("UPDATE clientes SET clie=13,desc ='hola'");
}
catch(Exception e) {
e.printStackTrace();
}
Me sale este error :
C:\tarea>java Boton2
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unk nown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)