• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

POSTGRESSQL + Android

arenasam

Lurker
Aug 19, 2011
2
0
Good afternoon staff,
I'm with a difficulty here and would like help from you guys,
tou trying to connect the android in postgreSQL database on a server that is,
but getting a tou, code:


public String Conectar(){
String retorno;
try {
String url;
url = "jdbc:postgresql://192.168.0.100:5432/bd_motel/";
Properties props = new Properties();
props.setProperty("user","postgres");
props.setProperty("password","123");
props.setProperty("ssl","false");
Class.forName("org.postgresql.Driver");
Connection conn = DriverManager.getConnection(url, props);

retorno = "Conectei!!!";
} catch (Exception e) {
msg = e.getMessage();
//System.out.println(msg);
retorno = msg;
}
return retorno;
}

I'm using android emulator 2.3.1
Postgre 9.0
java 1.7
and the library postgresql-9.0-801.jdbc4
has changed the claspath tbm but so far nothing, anyone have a suggestion?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones