connect to qws awl data base from android studio
Posted by: asaf anter
Date: August 10, 2018 09:36AM

i cannot manage to connect to aws sql databas from android studio.
i also cannot manage to conenct to my local host.

this is my code:



public void test(View view) {

Connection conn = null;


try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}


try {

String url = "jdbc:mysql://dbpark.cau22h5s8sgn.us-east-2.rds.amazonaws.com:3306/dbpark";
String user_name = "asafanter";
String password = "1234";
conn = DriverManager.
getConnection(url, user_name, password);

// Do something with the Connection


} catch (SQLException ex) {
// handle any errors
Log.i("SQLException: " , ex.getMessage());
Log.i("SQLState: " , ex.getSQLState());
// Log.i("VendorError: " , ex.getErrorCode());
}


where is the problem?

Options: ReplyQuote


Subject
Written By
Posted
connect to qws awl data base from android studio
August 10, 2018 09:36AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.