protected String doInBackground(String... params) {
try {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Connection conn = (Connection) DriverManager.getConnection(DB_Url, user_name, pass);
if (conn == null) {
msg = "Connection failed";
} else {
String query = "INSERT INTO mytable (data) VALUES('" + input_data + "')";
Statement statement = conn.createStatement();
}
} catch (SQLException e) {
e.printStackTrace();
}
return msg;
}
this Class is for background process to insert data into MySQL through Android application, with the help of JDBC library every thing fine but the method createStatement() is unresolvable
This is the error message:
enter image description here