we are trying to connect to the host using the code shown below:
Connection con=null;
try {
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://sql3.000webhost.com/a17644_cc","chat_cc", "pass");
ResultSet rs;
if(!con.isClosed())
{
Statement st = con.createStatement();
rs= st.executeQuery("SELECT * FROM user_info");
while(rs.next()){
t1.append(rs.getString(3));
}
}
} catch(Exception e) {
t1.setText(e.toString());
//e.printStackTrace();
} finally {
try {
if(con != null)
con.close();
}catch (java.sql.SQLException e) {
// TODO Auto-generated catch block
//e.printStackTrace();
t1.setText(e.toString());
}
we have given internet permission also in the manifest file.
But getting the following error:
java.sql.exception: data source rejected establishment of connection, message from server:"Host '182.71.248.226. is not allowed to connect to this MySQL server"
This is the following details i got: please tell which name we must give in the connection string Domain chitchat.site90.net Username a1740644 Password * Disk Usage 0.14 / 1500.0 MB Bandwidth 100000 MB (100GB) Home Root /home/a1740644 Server Name server19.000webhost.com IP Address 31.170.160.83 Apache ver. 2.2.19 (Unix) PHP version 5.2. MySQL ver. 5.1 Activated On 2012-05-01 02:14 Status Active