El driver : mysql-connector-java-3.0.17-ga
Y tengo algo parecido a esto :
Código JAVA:
Ver original
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); testDB(); } public void testDB() { tvBd = (TextView)this.findViewById(R.id.tvBd); try { Class.forName("com.mysql.jdbc.Driver"); /* System.out.println("Database connection success"); */ while(rs.next()) { result += rsmd.getColumnName(1) + ": " + rs.getInt(1) + "\n"; //result += rsmd.getColumnName(2) + ": " + rs.getString(2) + "\n"; //result += rsmd.getColumnName(3) + ": " + rs.getString(3) + "\n"; } tvBd.setText(result); } e.printStackTrace(); tvBd.setText(e.toString()); } }
Pero me tira un error de tipo :
java.sql.sqlexception data source rejected establishment of connection, message from server "nombre del pc" is not allowed connected to this mysqlServer
Cómo soluciono esto ?