Ok, first of all let me said that i'm done....don't know what else to do
Ok, i try to connect to a Mysql in my VPS (Heide SQL Runs perfect) Have root permition and i create a full user for the DB.
Install the jRDC.jar in the server and it's seems to working fine. So i try the RDC Example for B4J. i put the Northwind database in the server
after a LOT (A LOT!) of errors i finally come to this and no matter what i change... it always the same error... now, first the error
I try to google it and there is not to much clear info about ir.
Now the code (RDC Example actually)
now the config.properties
WHAT I TRY... In the client code
change cmd.Name = "select_Customers" to cmd.Name = "sql.select_Customers"
Same error
In the confir properties
Taking out 3306 Mysql Port
Change Localhost to 127.0.0.1
Change "Select * FROM Customers" to "Select CompanyName FROM Customers" to "SELECT CompanyName FROM northwind.Customers...
Same error
If some1 please help me i really apreciate it....Thanx!
Ok, i try to connect to a Mysql in my VPS (Heide SQL Runs perfect) Have root permition and i create a full user for the DB.
Install the jRDC.jar in the server and it's seems to working fine. So i try the RDC Example for B4J. i put the Northwind database in the server
after a LOT (A LOT!) of errors i finally come to this and no matter what i change... it always the same error... now, first the error
B4X:
Program started.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 </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 MariaDB server version for the right syntax to use near 'null' at line 1</pre></p>
<hr /><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.z-SNAPSHOT</a><hr/>
</body>
</html>
MAl: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'null' at line 1
I try to google it and there is not to much clear info about ir.
Now the code (RDC Example actually)
B4X:
#Region Project Attributes
#MainFormWidth: 500
#MainFormHeight: 500
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim reqManager As DBRequestManager
Dim TableView1 As TableView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
TableView1.Initialize("TableView1")
MainForm.RootPane.AddNode(TableView1, 0, 0, 0, 0)
MainForm.RootPane.SetAnchors(TableView1, 0, 0,0, 0) 'fill the screen
reqManager.Initialize(Me, "http://XXX.XXX.XXX.XXX:17178/rdc")
GetCostumer("data")
End Sub
Sub GetCostumer(test As String)
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "select_Customers"
cmd.Parameters = Array As Object()
reqManager.ExecuteQuery(cmd, 0, Null)
End Sub
Sub JobDone(Job As HttpJob)
If Job.Success = False Then
Log("MAl: " & Job.ErrorMessage)
Else
If Job.JobName = "DBRequest" Then
Dim result As DBResult = reqManager.HandleJob(Job)
reqManager.PrintTable(result)
reqManager.FillTableView(result, TableView1)
MainForm_Resize(MainForm.Width, MainForm.Height)
End If
End If
Job.Release
End Sub
Sub MainForm_Resize (Width As Double, Height As Double)
For i = 0 To TableView1.ColumnsCount - 1
TableView1.SetColumnWidth(i, (Width - 10dip)/ TableView1.ColumnsCount)
Next
End Sub
now the config.properties
B4X:
DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mydql://127.0.0.1:3306/northwind
user=yeahright
Password=yabadabadooo
#Java server port=17178
sql.select_Customers=SELECT CompanyName FROM Customers
#example of MS SQL Server configuration:
#DriverClass=net.sourceforge.jtds.jdbc.Driver
#JdbcUrl=jdbc:jtds:sqlserver://<server address>/<database>
WHAT I TRY... In the client code
change cmd.Name = "select_Customers" to cmd.Name = "sql.select_Customers"
Same error
In the confir properties
Taking out 3306 Mysql Port
Change Localhost to 127.0.0.1
Change "Select * FROM Customers" to "Select CompanyName FROM Customers" to "SELECT CompanyName FROM northwind.Customers...
Same error
If some1 please help me i really apreciate it....Thanx!
Last edited: