Android Question A question about RDC when insert data into mssql

liangchaozu

Member
Licensed User
Longtime User
I met a question when i access mssql database server with RDC.I can't insert data into mssql,but can delete,update,select.
i test select_animal,delete_animal and update_animal,the three commands are ok.Just insert_animal command is failed.
com.microsoft.sqlserver.jdbc.SQLServerException: com.microsoft.sqlserver.jdbc.SQLServerException:
Incorrect syntax near the keyword 'SET'.

who can help me?
1-jpg.19178

2-jpg.19179

3-jpg.19180
 

liangchaozu

Member
Licensed User
Longtime User
The error message is: Incorrect syntax near the keyword 'SET'. If you have changed the properties file then you need to restart the RDC server (or better set Debug=true)

Thanks.
I restart the RDC server when i change properties file every time.
There is no 'set' keyword in the insert_animal sql statement,so I doubt if it's a bug of RDC server.
 
Upvote 0

liangchaozu

Member
Licensed User
Longtime User
Have you added SET in one of your attempts?
No.
I create a new statement:
sql.insertinto_animal=INSERT into Pexist.dbo.animals(name,id) VALUES(?,?)
then run,got a new error msg:missing statement insertinto_animal, because I forgot to change client code:cmd.Name = "insert_animal".
After i changed client code,that error is still show.
 
Upvote 0

liangchaozu

Member
Licensed User
Longtime User
No.
I create a new statement:
sql.insertinto_animal=INSERT into Pexist.dbo.animals(name,id) VALUES(?,?)
then run,got a new error msg:missing statement insertinto_animal, because I forgot to change client code:cmd.Name = "insert_animal".
After i changed client code,that error is still show.
After i changed client code,that error is still show. i mean that error:
com.microsoft.sqlserver.jdbc.SQLServerException: com.microsoft.sqlserver.jdbc.SQLServerException:
Incorrect syntax near the keyword 'SET'.
 
Upvote 0

Sytek

Active Member
Licensed User
Longtime User
1-jpg.19178

2-jpg.19179

3-jpg.19180


Hi There, I got this error while trying this one over RDC conector

PHP:
DriverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
JdbcUrl=jdbc:microsoft:sqlserver://localhost:1443;databaseName=almacen
User=sa
Password=xxxxxxxx
ServerPort=17178
C:\RemoteDatabaseConnector>"C:\Program Files (x86)\Java\jre7\bin\java" -Xmx256m
-cp .;libs\*;jdbc_driver\* anywheresoftware.b4a.remotedatabase.RemoteServer
B4A Remote Database Connecter (version 0.9)
loading: C:\RemoteDatabaseConnector\config.properties
2013-08-29 22:41:29.183:INFO::jetty-7.4.2.v20110526
2013-08-29 22:41:29.214:INFO::started o.e.j.s.ServletContextHandler{/,null}
ago 29, 2013 10:41:29 PM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
ago 29, 2013 10:41:29 PM 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]
2013-08-29 22:41:29.464:INFO::Started [email protected]:17178 START
ING
ago 29, 2013 10:41:33 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource g
etPoolManager
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 -> 100000, connectionCustomizerClassName -> null, connectio
nTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSource
Name -> 1hge1ac8w1l332v01x3sv5q|96d2c2, debugUnreturnedConnectionStackTraces ->
false, description -> null, driverClass -> com.microsoft.sqlserver.jdbc.SQLServe
rDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> fals
e, identityToken -> 1hge1ac8w1l332v01x3sv5q|96d2c2, idleConnectionTestPeriod ->
60000, initialPoolSize -> 3, jdbcUrl -> jdbc:microsoft:sqlserver://localhost:144
3;databaseName=almacen, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, m
axIdleTime -> 18000, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxSt
atements -> 150, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThr
eads -> 3, preferredTestQuery -> null, properties -> {user=******, password=****
**}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnect
ionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTi
meout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
ago 29, 2013 10:42:03 PM com.mchange.v2.resourcepool.BasicResourcePool$Scattered
AcquireTask run
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2b2f
ec -- 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: No suitable driver
at java.sql.DriverManager.getDriver(Unknown Source)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataS
ource.java:240)
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)

ago 29, 2013 10:42:03 PM com.mchange.v2.resourcepool.BasicResourcePool forceKill
Acquires
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicR
esourcePool@86b7bb is interrupting all Threads waiting on a resource to check ou
t. Will try again in response to new client requests.
ago 29, 2013 10:42:03 PM com.mchange.v2.resourcepool.BasicResourcePool$Scattered
AcquireTask run
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2b2f
ec -- 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: No suitable driver
at java.sql.DriverManager.getDriver(Unknown Source)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataS
ource.java:240)
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)

java.sql.SQLException: Connections could not be acquired from the underlying dat
abase!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConne
ction(C3P0PooledConnectionPool.java:689)
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.CannotAcquireResourceException: A Resourc
ePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicRes
ourcePool.java:1418)
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
ago 29, 2013 10:42:03 PM com.mchange.v2.resourcepool.BasicResourcePool forceKill
Acquires
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicR
esourcePool@86b7bb is interrupting all Threads waiting on a resource to check ou
t. Will try again in response to new client requests.
ago 29, 2013 10:42:03 PM com.mchange.v2.resourcepool.BasicResourcePool$Scattered
AcquireTask run
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1575
0e4 -- 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: No suitable driver
at java.sql.DriverManager.getDriver(Unknown Source)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataS
ource.java:240)
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)

ago 29, 2013 10:42:03 PM com.mchange.v2.resourcepool.BasicResourcePool forceKill
Acquires
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicR
esourcePool@86b7bb is interrupting all Threads waiting on a resource to check ou
t. Will try again in response to new client requests.
Would you please Help me?
Best Regards
 
Last edited:
Upvote 0

liangchaozu

Member
Licensed User
Longtime User
Hi There, I got this error while trying this one over RDC conector

PHP:
DriverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
JdbcUrl=jdbc:microsoft:sqlserver://localhost:1443;databaseName=almacen
User=sa
Password=bb6761658
ServerPort=17178

Would you please Help me?
Best Regards

try to delete microsoft:
JdbcUrl=jdbc:sqlserver://localhost:1443;databaseName=almacen

and make sure DriverClass path is correct. Mine is com.microsoft.sqlserver.jdbc.SQLServerDriver.

1.JPG
 
Upvote 0

Sytek

Active Member
Licensed User
Longtime User
"liangchaozu, post: 188128, member: 34728"]try to delete microsoft:
JdbcUrl=jdbc:sqlserver://localhost:1443;databaseName=almacen

and make sure DriverClass path is correct. Mine is com.microsoft.sqlserver.jdbc.SQLServerDriver.

@Erel : Thank's But I'm not sending info, I'm just testing the RDC Connection.
@liangchaozu : Thank's, That did the trick, and some user configuration issues at sql server 2008, forgot to include the mixed option access.
Best Regards!
 
Upvote 0
Top