Hi all:
I've been using jRDC2 for a while to access mysql with no problems. Now, I need to access another database in the same server, and I would like to use the same jRDC2 server.
I've seen in
https://www.b4x.com/android/forum/threads/jrdc2-connect-two-or-more-mysql-databases.98569/
you can connect differents databases just using 'db.table' in SQL.
My config.properties:
Accessing to semi database with no problem.
Now I want to access to 'peru' database in the same server.
So I'm using as sql
but I'm getting
I've seen in
https://www.b4x.com/android/forum/t...and-object-should-first-be-initialized.97512/
The OP had a problem with a field in the database, but I've not added any new field. I had a table called "task" in my original semi database, so I've deleted it to see if it was the problem.
Watching the error ('semi.peru.emplazamientos' doesn't exist) I've changed my config.properties to:
and sql command to
But then I get just the two first lines of error (Object should first be initialized).
Watching the code in RDCHandler, I think the problem must be "rs" is getting no value or something like that.
Any help is welcome.
Thanks in advance
I've been using jRDC2 for a while to access mysql with no problems. Now, I need to access another database in the same server, and I would like to use the same jRDC2 server.
I've seen in
https://www.b4x.com/android/forum/threads/jrdc2-connect-two-or-more-mysql-databases.98569/
you can connect differents databases just using 'db.table' in SQL.
My config.properties:
B4X:
#DATABASE CONFIGURATION
DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost:3306/semi?characterEncoding=utf8
User=root
Password=xxxxxxxx
#Java server port
ServerPort=8090
Now I want to access to 'peru' database in the same server.
So I'm using as sql
B4X:
sql.selectTasks = SELECT * FROM `peru.tasks`
B4X:
(RuntimeException) java.lang.RuntimeException: Object should first be initialized (JavaObject).
Command: , took: 870ms, client=192.168.1.132
(MySQLSyntaxErrorException) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'semi.peru.emplazamientos' doesn't exist
Command: , took: 31ms, client=192.168.1.132
I've seen in
https://www.b4x.com/android/forum/t...and-object-should-first-be-initialized.97512/
The OP had a problem with a field in the database, but I've not added any new field. I had a table called "task" in my original semi database, so I've deleted it to see if it was the problem.
Watching the error ('semi.peru.emplazamientos' doesn't exist) I've changed my config.properties to:
B4X:
JdbcUrl=jdbc:mysql://localhost:3306/peru?characterEncoding=utf8
B4X:
sql.selectTasks = SELECT * FROM `tasks`
But then I get just the two first lines of error (Object should first be initialized).
Watching the code in RDCHandler, I think the problem must be "rs" is getting no value or something like that.
B4X:
Dim rs As ResultSet = con.ExecQuery2(Main.rdcConnector1.GetCommand(cmd.Name), cmd.Parameters)
If limit <= 0 Then limit = 0x7fffffff 'max int
Dim jrs As JavaObject = rs
Dim rsmd As JavaObject = jrs.RunMethod("getMetaData", Null)
Any help is welcome.
Thanks in advance