This code hasn't error or exception, but after running the table features in the data base remain empty
try {
Class.forName("com.mysql.jdbc.Driver");
con= (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/sounds","root","");
statment = (Statement) con.createStatement();
String query = "INSERT INTO featuers (avg_Bandwidth) values (?)";
PreparedStatement preparedStmt = (PreparedStatement)con.prepareStatement(query);
preparedStmt.setDouble(1, avarage_Bandwidth);
preparedStmt.executeUpdate();
con.close();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
SqlException!!DriverManager) are required (by the JDBC spec) to be autoCommit=true.finallyblock.