我可以使用jguc驱动程序与java gui,但我不能使用android.i添加mysql连接jar和我使用相同的连接信息(ip-name-pass).compiler dosnt给我错误,但它不工作。它可能在android上使用jdbc?
在这些代码中,我从不接受“bağlantıbaşarılı”消息
try {Toast.makeText(getApplicationContext(),
"driverbağlantısı", Toast.LENGTH_LONG).show();
Class.forName("com.mysql.jdbc.Driver");
try {
Toast.makeText(getApplicationContext(),
"başlıyor", Toast.LENGTH_LONG).show();
conn = DriverManager.getConnection("jdbc:mysql://000.000.000.000/sdsa" , "root", "pass");
Toast.makeText(getApplicationContext(),
"bağlantı başarılı", Toast.LENGTH_LONG).show();
} catch (SQLException e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(),
"bağlantı başarısız", Toast.LENGTH_LONG).show();
}
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
};
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(),
"driver hatası"+e.getMessage(), Toast.LENGTH_LONG).show();
}