Android Question RDC First mySQL call Error 404

mmieher

Active Member
Licensed User
Longtime User
RDC newbie here ...

With the forum's help I got the jRDC Server running on my remote server:

http://ctt.wvhops.com:17178/test

RemoteServer is running (11/15/2017 05:08:39)
Connection successful.

However, my first attempt to execute an SQL statement shows this in the b4A log:

*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /. Reason:
<pre> Not Found</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
</body>
</html>
Error: Not Found
** Activity (main) Pause, UserClosed = false **

Modified RemoveServerClient as follows:

B4X:
Sub Activity_Create(FirstTime As Boolean)
   
    If FirstTime Then
       
    '    reqManager.Initialize(Me, "http://192.168.0.100:17178")
        reqManager.Initialize(Me, "http://ctt.wvhops.com:17178")
       
    End If
   
End Sub

Sub Activity_Click
'    GetAnimal("1")   
    GetCustomers
   
End Sub

Sub GetCustomers
   
    Dim cmd As DBCommand
    cmd.Initialize
   
    cmd.Name = "SelectAllCustomers"
   
    cmd.Parameters = Array As Object()
    reqManager.ExecuteQuery(cmd, 0, Null)
   
End Sub

config.properties stuff:

#DATABASE CONFIGURATION
DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8

#SQL COMMANDS
#sql.create_table=CREATE TABLE IF NOT EXISTS animals (\
# id INTEGER PRIMARY KEY AUTO_INCREMENT,\
# name CHAR(30) NOT NULL,\
# image BLOB)
#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.select=select * from article
sql.insert=INSERT INTO article VALUES(?, ?)

sql.SelectAllCustomers=SELECT CustID FROM customers


I imagine solution is something simple but I cannot find it.

Marc
 

OliverA

Expert
Licensed User
Longtime User
You just forgot the /rdc in your URL.
B4X:
reqManager.Initialize(Me, "http://ctt.wvhops.com:17178/rdc")
 
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
Thanks again, Oliver! It worked. I see my table values in the log.

I do see one strange log message before that: Error: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.customers' doesn't exist

The name of the database is CTT. I cannot find where any code is referencing a db named "test".

But in any event, it worked!
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
I previously did change to JdbcUrl=jdbc:mysql://localhost/CTT?characterEncoding=utf8

That must have been an old log message.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…