0

I want to connect to mysql without any php service, is that possible?

Amaan Khan
  • 181
  • 2
  • 3
  • 15

1 Answers1

0

Use jdbc like this:

String url = "http://localhost/SomeDB";
String user = "someUser";
String pass = "somePass";

Class.forName(com.mysql.jdbc.Driver);
Connection con = DriverManager.getConnection(url, user, pass);
Statement st = con.createStatement();
ResultSet = st.executeQuery(SELECT * FROM Table);

String result1 = ResultSet.getString(0);

For the

Class.forName(com.mysql.jdbc.Driver);

You need the sql connect android library (jar file), just search on Google ;)