Is there anyone who tried JDBC connection in android because in Android 2.3 JDBC is supported.
I have to connect with Mysql without web service.
I have made application but it gives me error
public class MysqlConnect extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
System.out.println("MySQL Connect Example.");
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/";
String dbName = "jdbctutorial";
String driver = "com.mysql.jdbc.Driver";
String userName = "root";
String password = "root";
try {
Class.forName(driver).newInstance();
conn = DriverManager.getConnection(url+dbName,userName,password);
System.out.println("Connected to the database");
conn.close();
System.out.println("Disconnected from database");
} catch (Exception e) {
e.printStackTrace();
}
}
}
i am getting error in getConnection. error is like java.lang.VerifyError : com.mysql.jdbc.MysqlIO
Thanks in advance.