witam
mam takie cos po kliknieciu buttona:
{
Connection con = null;
String url = "jdbc:mysql://localhost/";
String db = "dojazdy";
String driver = "com.mysql.jdbc.Driver";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"silentbob","haslo");
try{
Statement st = con.createStatement();
st.executeUpdate("insert into users (firstname, lastname, username, password) values('user6','user6','user6','user6')");
this.jLabel6.setText("poszlo");
}
catch (SQLException s){
}
}
catch (Exception e){
e.printStackTrace();
}
}
wpisalem wartosci na sztywno, zeby przetestowac, bo probowalem juz na inne sposoby i nie dziala to jak trzeba, nie udate'uje. pomoze ktos? ;/