I want to add data entered from Java GUI into mysql database and inside actionlestener I am using the following code:
String s1;
JTextField enterdata = new JTextField(10);
s1=enterdata.getText();
PreparedStatement ps = con.prepareStatement("INSERT INTO d (name) VALUES (?)");
ps.setString(1, s1);
ps.executeUpdate();
'name' is the column in database;
i am having a successful connection to database but the data field entry into database is blank but on every insertion, it prompts 1 row inserted but the data is not seen inside the database.
please help.