Hi,
i am writing an app to connect to my mysql server and to run a simple query against it. I've managed to connect to my db fine and i am currently writing a java file called Query with the code snipet
Connection con = DriverManager.getConnection("internet_app_design");
Statement stmt = null;
if (con == null) {
System.err.println("Can't connect to database");
System.exit(0);
}
try {
stmt = con.createStatement();
i have all my import statements being
import com.mysql.jdbc.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
but everytime i do the stmt code, i get an error saying incompatible types but i've seen quite a few tutorial with similar stmt code e.g
http://www.stardeveloper.com/articles/display.html?article=2003091001&page=1
what should i do to rectify this?
cheers