K kongc Member Licensed User Longtime User Sep 9, 2013 #1 I'm trying the examples and tutorials of RDC with SQLite database but failed. Ref: http://www.b4x.com/android/forum/threads/remote-database-connector-connect-to-any-remote-db.31540/ http://www.b4x.com/android/forum/threads/rdc-simple-way-to-create-your-own-back-end-database.31616/ http://www.b4x.com/android/forum/threads/remote-database-connector-files.31541/ The error I got is as below when running with emulator:- ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** startService: class anywheresoftware.b4a.samples.httputils2.httputils2service ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** Error: org.apache.http.conn.HttpHostConnectException: Connection to http://127.0.0.1:17178 refused I tried to access the Java server from the browser http://127.0.0.1:17178/?method=test, and have no problem " RemoteServer is running (Tue Sep 10 00:11:21 SGT 2013) Connection successful. " Note: Below steps had been done. 1) amendment of config.properties DriverClass=org.sqlite.JDBC JdbcUrl=jdbc:sqlite:C:/dbdemos.db3 2) file sqlite-jdbc-3.7.2.jar had coppied to jdbc_driver Any idea how come the connection is refused? Thanks.
I'm trying the examples and tutorials of RDC with SQLite database but failed. Ref: http://www.b4x.com/android/forum/threads/remote-database-connector-connect-to-any-remote-db.31540/ http://www.b4x.com/android/forum/threads/rdc-simple-way-to-create-your-own-back-end-database.31616/ http://www.b4x.com/android/forum/threads/remote-database-connector-files.31541/ The error I got is as below when running with emulator:- ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** startService: class anywheresoftware.b4a.samples.httputils2.httputils2service ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** Error: org.apache.http.conn.HttpHostConnectException: Connection to http://127.0.0.1:17178 refused I tried to access the Java server from the browser http://127.0.0.1:17178/?method=test, and have no problem " RemoteServer is running (Tue Sep 10 00:11:21 SGT 2013) Connection successful. " Note: Below steps had been done. 1) amendment of config.properties DriverClass=org.sqlite.JDBC JdbcUrl=jdbc:sqlite:C:/dbdemos.db3 2) file sqlite-jdbc-3.7.2.jar had coppied to jdbc_driver Any idea how come the connection is refused? Thanks.
Erel B4X founder Staff member Licensed User Longtime User Sep 10, 2013 #2 127.0.0.1 (localhost) points to the current machine. It will never work as RDC is not running on the Android device. If you are running it on the emulator then you can use the IP address: 10.0.2.2 this is a special value (in the emulator only) that points to the hosting machine local host. With a real device you need to set the computer IP address. You will also need to make sure that the firewall permits incoming connections on this port. Upvote 0
127.0.0.1 (localhost) points to the current machine. It will never work as RDC is not running on the Android device. If you are running it on the emulator then you can use the IP address: 10.0.2.2 this is a special value (in the emulator only) that points to the hosting machine local host. With a real device you need to set the computer IP address. You will also need to make sure that the firewall permits incoming connections on this port.