Android Question jRDC2 - (Remote Database Connector)

Nickle

Member
Licensed User
Longtime User
Sorry to take your guys back. I have followed Erel's tutorial AS-IS but getting below error. Code is Same and MySql in config is just simple select All. Cant figure out whats wrong as sql statement runs fine and code is Just as is. Server runs fine without error except when called by client.

** Activity (dashboard) Pause, UserClosed = false **
** Activity (driversetup) Create, isFirst = false **
** Activity (driversetup) Resume **
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;null&apos; at line 1</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /rdc. Reason:
<pre> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;null&apos; at line 1</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
</body>
</html>
ERROR: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null' at line 1

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Driver")
    GetUser
End Sub

Sub GetUser
    Dim req As DBRequestManager = CreateRequest
    Dim cmd As DBCommand = CreateCommand("sql.selectallusers", Null)
    Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
    If j.Success Then
        req.HandleJobAsync(j, "req")
        Wait For (req) req_Result(res As DBResult)
        'work with result
        req.PrintTable(res)
    Else
        Log("ERROR: " & j.ErrorMessage)
    End If
    j.Release
End Sub


Sub Activity_Resume


B4X:
#DATABASE CONFIGURATION
#DATABASE CONFIGURATION
DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost/bashtech?characterEncoding=utf8
User=root
Password=
#Java server port
ServerPort=17178

#example of MS SQL Server configuration:
#DriverClass=net.sourceforge.jtds.jdbc.Driver
#JdbcUrl=jdbc:jtds:sqlserver://<server address>/<database>

#example of postegres configuration:
#JdbcUrl=jdbc:postgresql://localhost/test
#DriverClass=org.postgresql.Driver

#SQL COMMANDS
#sql.insert_animal=INSERT INTO animals VALUES (null, ?,?)
#sql.select_animal=SELECT name, image, id FROM animals
#sql.create_table=CREATE TABLE article (col1 numeric(10,4) ,col2 text);
#sql.insert=INSERT INTO article VALUES(?, ?)
sql.selectallusers=SELECT username FROM users
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Nickle

Member
Licensed User
Longtime User
hmmmm Not sure what I was thinking. Its really great to be part of this community. Thanks DonManfred
 
Upvote 0
Top