Android Tutorial Remote Database Connector (RDC) - Connect to any remote DB

Status
Not open for further replies.

dibesw

Active Member
Licensed User
Longtime User
Hello Erel!
If server is unavailable, how Do I call timeout event?
Thanks!
 

dibesw

Active Member
Licensed User
Longtime User
Thanks Erel.
I had a program in Jackaccess that I have translated in RDC
My programs works in both Jackcess that in RDC, but I must have two version of the program:
Is there a possibility to operate in RDC version at the same time read a mdb database in local (readindg mdb database in File.DirRootExternal)?
Thanks!
 

dibesw

Active Member
Licensed User
Longtime User
Erel, I saw that the database password is set to server side but not in client side.
This can be dangerous because any client could access to server and there is no control.
Is there a possibility for set up database password in client side?
Thanks!
 

driesvp

Member
Licensed User
Longtime User
Hello All,

Small problem, I miss something. I receive following error:

Parsing code. Error
Error parsing program.
Error description: Unknown type: httpjob
Are you missing a library reference?
Occurred on line: 55
Sub JobDone (Job As httpjob )

I added the modules HttpUtils and HttpUtilsService and I marked the lib HTTP.

Is the problem raising because I'm using v2.52?

Sincerely
 

air cover

Member
Licensed User
Longtime User
This tutorial makes no sense to me, sorry. Does it want to turn my development PC into a web server?! Crazy.

Instead, how would I set up a cloud solution such as hosting a MySQL db on 000webhost.com? And even if someone is kind enough to give me that answer...that only takes care of the Server.

Then is there some example code for an Android phone app accessing that MySQL db?

...and if the above are both working, will the MySQL db support thousands of Android phone apps hitting that MySQL db simultaneously?

I've looked at several "tutorials" and they seem to skip basic steps in explaining setup and architecture. One earlier tutorial insists that Basic4 can't directly access a MySQL db remotely, but rather needs to go through a hosted .php file to get to the db?
 

driesvp

Member
Licensed User
Longtime User
Dear,

I encounter following problem. Anyone an idea how to solve this?

B4X:
"C:\Program Files\Java\jre7\bin\java" -Xmx256m -cp .;libs
\*;jdbc_driver\* anywheresoftware.b4a.remotedatabase.RemoteServer
B4A Remote Database Connecter (version 0.9)
loading: H:\AutoRapport\Android\config.properties
2014-01-09 08:40:30.114:INFO::jetty-7.4.2.v20110526
2014-01-09 08:40:30.192:INFO::started o.e.j.s.ServletContextHandler{/,null}
jan 09, 2014 8:40:30 AM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
jan 09, 2014 8:40:30 AM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.2.1 [built 20-March-2013 11:16:28 +0000; debug? true
; trace: 10]
2014-01-09 08:40:30.817:INFO::Started [EMAIL]SelectChannelConnector@0.0.0.0:17178[/EMAIL] START
ING
jan 09, 2014 8:40:40 AM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource ge
tPoolManager
INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acqu
ireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCo
mmitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> fa
lse, checkoutTimeout -> 20000, connectionCustomizerClassName -> null, connection
TesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceN
ame -> 1hbsa9p8zwq4f2zki0dp6|94cbe2, debugUnreturnedConnectionStackTraces -> fal
se, description -> null, driverClass -> net.sourceforge.jtds.jdbc.Driver, factor
yClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToke
n -> 1hbsa9p8zwq4f2zki0dp6|94cbe2, idleConnectionTestPeriod -> 600, initialPoolS
ize -> 3, jdbcUrl -> jdbc:jtds:sqlserver://SQL-SERVER/VeosProductie, maxAdminist
rativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExce
ssConnections -> 0, maxPoolSize -> 15, maxStatements -> 150, maxStatementsPerCon
nection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> nul
l, properties -> {user=******, password=******}, propertyCycle -> 0, statementCa
cheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectio
nOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, use
sTraditionalReflectiveProxies -> false ]
jan 09, 2014 8:41:10 AM com.mchange.v2.resourcepool.BasicResourcePool$ScatteredA
cquireTask run
WARNING: [EMAIL]com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1504[/EMAIL]
1ec -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to
acquire a needed new resource, we failed to succeed more than the maximum number
 of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: Login failed for user 'mobiel'.  Reason: The password of
the account has expired.
  at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.j
ava:372)
  at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
  at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
  at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:632)
  at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:3
71)
  at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
  at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManag
erDataSource.java:146)
  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnecti
on(WrapperConnectionPoolDataSource.java:195)
  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnecti
on(WrapperConnectionPoolDataSource.java:184)
  at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionRe
sourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)
  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResource
Pool.java:1086)
  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPe
ndingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073)
  at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourc
ePool.java:44)
  at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.ru
n(BasicResourcePool.java:1810)
  at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:648)
jan 09, 2014 8:41:10 AM com.mchange.v2.resourcepool.BasicResourcePool$ScatteredA
cquireTask run
WARNING: [EMAIL]com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@13ee[/EMAIL]
a2f -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to
acquire a needed new resource, we failed to succeed more than the maximum number
 of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: Login failed for user 'mobiel'.  Reason: The password of
the account has expired.
  at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.j
ava:372)
  at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
  at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
  at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:632)
  at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:3
71)
  at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
  at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManag
erDataSource.java:146)
  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnecti
on(WrapperConnectionPoolDataSource.java:195)
  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnecti
on(WrapperConnectionPoolDataSource.java:184)
  at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionRe
sourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)
  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResource
Pool.java:1086)
  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPe
ndingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073)
  at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourc
ePool.java:44)
  at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.ru
n(BasicResourcePool.java:1810)
  at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:648)
jan 09, 2014 8:41:10 AM com.mchange.v2.resourcepool.BasicResourcePool$ScatteredA
cquireTask run
WARNING: [EMAIL]com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1818[/EMAIL]
b6 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to a
cquire a needed new resource, we failed to succeed more than the maximum number
of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: Login failed for user 'mobiel'.  Reason: The password of
the account has expired.
  at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.j
ava:372)
  at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
  at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
  at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:632)
  at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:3
71)
  at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
  at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManag
erDataSource.java:146)
  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnecti
on(WrapperConnectionPoolDataSource.java:195)
  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnecti
on(WrapperConnectionPoolDataSource.java:184)
  at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionRe
sourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)
  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResource
Pool.java:1086)
  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPe
ndingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073)
  at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourc
ePool.java:44)
  at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.ru
n(BasicResourcePool.java:1810)
  at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:648)
jan 09, 2014 8:41:10 AM com.mchange.v2.resourcepool.BasicResourcePool forceKillA
cquires
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicR
[EMAIL]esourcePool@4ef185[/EMAIL] is interrupting all Threads waiting on a resource to check ou
t. Will try again in response to new client requests.
jan 09, 2014 8:41:10 AM com.mchange.v2.resourcepool.BasicResourcePool forceKillA
cquires
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicR
[EMAIL]esourcePool@4ef185[/EMAIL] is interrupting all Threads waiting on a resource to check ou
t. Will try again in response to new client requests.
jan 09, 2014 8:41:10 AM com.mchange.v2.resourcepool.BasicResourcePool forceKillA
cquires
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicR
[EMAIL]esourcePool@4ef185[/EMAIL] is interrupting all Threads waiting on a resource to check ou
t. Will try again in response to new client requests.
java.sql.SQLException: An attempt by a client to checkout a Connection has timed
 out.
  at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
  at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:77)
  at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConne
ction(C3P0PooledConnectionPool.java:687)
  at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(A
bstractPoolBackedDataSource.java:140)
  at anywheresoftware.b4a.remotedatabase.Servlet.doGet(Servlet.java:64)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:538
)
  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java
:478)
  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl
er.java:937)
  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:
406)
  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle
r.java:871)
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j
ava:117)
  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper
.java:110)
  at org.eclipse.jetty.server.Server.handle(Server.java:346)
  at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.
java:589)
  at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete
(HttpConnection.java:1048)
  at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:601)
  at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
  at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:41
1)
  at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEn
dPoint.java:535)
  at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEnd
Point.java:40)
  at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool
.java:529)
  at java.lang.Thread.run(Unknown Source)
Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out whil
e waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePo
[EMAIL]ol@4ef185[/EMAIL] -- timeout at awaitAvailable()
  at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicRes
ourcePool.java:1416)
  at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(
BasicResourcePool.java:606)
  at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicR
esourcePool.java:526)
  at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConn
ectionInUse(C3P0PooledConnectionPool.java:755)
  at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConne
ction(C3P0PooledConnectionPool.java:682)
  ... 21 more[\code]
 

driesvp

Member
Licensed User
Longtime User
This is the relevant error:

ava.sql.SQLException: Login failed for user 'mobiel'. Reason: The password of the account has expired.

Thanks, it works now. Such a simple thing that I didn't recognize
 

Softflow Systems

Member
Licensed User
Longtime User
http://localhost:17178/?method=abc
gives
java.io.EOFException
in RDC
what does that mean
My Connection.properties file is like this
#Lines starting with '#' are comments.
#Backslash character at the end of line means that the command continues in the next line.
#SQL Server
DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://localhost:17178/abc
User=new
Password=123
ServerPort=17178
#If Debug is true then this file will be reloaded on every query.
#This is useful if you need to modify the queries.
Debug=true
#commands
sql.select_party=SELECT party_nm, acc_id FROM z_par_0001 WHERE bal_cd = 'A5'
 

Fifi Donkor

Member
Licensed User
Longtime User
That's exactly where your problem is, Patrick. Youre opening a PostgreSQL database but referencing a mysql jdbc. Its 2 months after your post but this is just for the benefit of others who might be in a similar situation, since nobody answered your question.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…