Hi
I have been trying to connect to my database with no luck. I have been thru the tutorials and tried all the examples as well as adding my IP address on the server as one of the ones allowed to access.
I have also used another SQL program and it access my database from my IP address with exactly the same info, I copied and pasted.
It seems like I am missing something
The error code is
Error: (SQLException) java.sql.SQLException: Access denied for user ''@'169.0.105.121' (using password: NO)
Which normally tells me my Ip is not authorised, but it is.
Here is the code, BTW I have changed the usernames and passwords to something else
Thank you for any advice you may provide
I have been trying to connect to my database with no luck. I have been thru the tutorials and tried all the examples as well as adding my IP address on the server as one of the ones allowed to access.
I have also used another SQL program and it access my database from my IP address with exactly the same info, I copied and pasted.
It seems like I am missing something
The error code is
Error: (SQLException) java.sql.SQLException: Access denied for user ''@'169.0.105.121' (using password: NO)
Which normally tells me my Ip is not authorised, but it is.
Here is the code, BTW I have changed the usernames and passwords to something else
B4X:
Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 400
#AdditionalJar: mysql-connector-java-5.1.41-bin
#End Region
Sub Process_Globals
Private Fx As JFX
Private MainForm As Form
Private Sql1 As SQL
Private Url, Driver, UserName, PassWord As String
Dim ListView1 As ListView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1")
MainForm.Show
Try
Driver = "com.mysql.jdbc.Driver"
Url = "jdbc:mysql://www.himel.co.za:3306/himel_dia"
UserName = "himel_peter"
PassWord = "3749957)P"
Sql1.Initialize(Driver, Url & ";user=" & UserName & ";password=" & PassWord)
' sql1.Initialize("com.mysql.jdbc.Driver","jdbc:mysql://localhost/test?characterEncoding=utf8")
Dim rs As ResultSet
rs = Sql1.ExecQuery("SELECT * FROM Customer;")
ListView1.Items.Add(rs)
Log("result: " & LastException)
Catch
Log("Error: " & LastException)
End Try
End Sub
Thank you for any advice you may provide