android - Connection to remote postgreSQL database timed out with JDBC -


so trying connect android app postgresql database jdbc, although driver part went fine, connection timing out, i've authorized connections ip in pg_hba file, tried search on internet, noone of answer suits or problem.

here's code connect :

   string url = "jdbc:postgresql://hostingmachineip:5432/mytestdb?user=user&password=password";             connection = drivermanager.getconnection(url); 

i've put line in pg_hba conf file :

    host                            0.0.0.0/0            trust 

and error :

 i/system.out: -------- postgresql jdbc connection testing ------------  i/system.out: postgresql jdbc driver registered!  e/dalvikvm: not find class 'org.postgresql.translation.messages_fr$1',                     referenced method org.postgresql.translation.messages_fr.getkeys  w/dalvikvm: vfy: unable resolve new-instance 3930 (lorg/postgresql/translation/messages_fr$1;) in  lorg/postgresql/translation/messages_fr; d/dalvikvm: vfy: replacing opcode 0x22 @ 0x0014 d/dalvikvm: dexopt: unable opt direct call 0x745a @ 0x16 in lorg/postgresql/translation/messages_fr;.getkeys  i/system.out: connection failed! check output console       error : la tentative de connexion échoué.08001 w/system.err: org.postgresql.util.psqlexception: la tentative de connexion échoué. w/system.err:     @ org.postgresql.core.v3.connectionfactoryimpl.openconnectionimpl(connectionfactoryimpl.java:272) w/system.err:     @ org.postgresql.core.connectionfactory.openconnection(connectionfactory.java:51) w/system.err:     @ org.postgresql.jdbc.pgconnection.<init>(pgconnection.java:215) w/system.err:     @ org.postgresql.driver.makeconnection(driver.java:404) w/system.err:     @ org.postgresql.driver.connect(driver.java:272) w/system.err:     @ java.sql.drivermanager.getconnection(drivermanager.java:179) w/system.err:     @ java.sql.drivermanager.getconnection(drivermanager.java:144) w/system.err:     @ com.adm.nirmee.mainactivity.setmapsuper(mainactivity.java:88) w/system.err:     @ java.lang.reflect.method.invokenative(native method) w/system.err:     @ java.lang.reflect.method.invoke(method.java:515) w/system.err:     @ android.support.v7.app.appcompatviewinflater$declaredonclicklistener.onclick(appcompatviewinflater.java:288) w/system.err:     @ android.view.view.performclick(view.java:4569) w/system.err:     @ android.view.view$performclick.run(view.java:18553) w/system.err:     @ android.os.handler.handlecallback(handler.java:733) w/system.err:     @ android.os.handler.dispatchmessage(handler.java:95) w/system.err:     @ android.os.looper.loop(looper.java:212) w/system.err:     @ android.app.activitythread.main(activitythread.java:5137) w/system.err:     @ java.lang.reflect.method.invokenative(native method) w/system.err:     @ java.lang.reflect.method.invoke(method.java:515) w/system.err:     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:902) w/system.err:     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:718) w/system.err:     @ dalvik.system.nativestart.main(native method) w/system.err: caused by: java.net.sockettimeoutexception: failed connect /hostingmachineip (port 5432) after 10000ms w/system.err:     @ libcore.io.iobridge.connecterrno(iobridge.java:163) w/system.err:     @ libcore.io.iobridge.connect(iobridge.java:116) w/system.err:     @ java.net.plainsocketimpl.connect(plainsocketimpl.java:192) w/system.err:     @ java.net.plainsocketimpl.connect(plainsocketimpl.java:460) w/system.err:     @ java.net.socket.connect(socket.java:838) w/system.err:     @ org.postgresql.core.pgstream.<init>(pgstream.java:61) w/system.err:     @ org.postgresql.core.v3.connectionfactoryimpl.openconnectionimpl(connectionfactoryimpl.java:144) w/system.err:   ... 21 more 

i'm lost @ point, can guys me please..


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -