Hello.
I have used the SQL connector for MySQL database on Windows in some of my projects in B4J.
My question is if i can do the same with an Arduino Mega + ethernet shield, I know that the jSQL library is based on java , but i saw here https://github.com/ChuckBell/MySQL_Connector_Arduino that there is a connector for mysql.
I should mention that I don`t really know how to work with http requests, and i dont have some jServer that i can connect to also I dont have xammp or other http server . I just want to store/read some data from mySQL server directly like i did with jSQl.
I don`t know if that`s possible, any help would be appreciated.
On a second note, i noticed that on my MEGA 2560 with a shield attached i have :
always returns after a while "Error connecting to network", but if i have:
it returns the ip i`ve set, i don`t know why my DHCP server wont give me an ip.
Thank you.
I have used the SQL connector for MySQL database on Windows in some of my projects in B4J.
B4X:
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#AdditionalJar: mysql-connector-java-5.1.39-bin.jar
#End Region
...
Private pool As ConnectionPool
pool.Initialize("com.mysql.jdbc.Driver", "jdbc:mysql://" & SqlServerIp & ":port/smt?autoReconnect=true&useSSL=true","user","password")
Dim sql1 As SQL=pool.GetConnection
' My code
sql1.Close
I should mention that I don`t really know how to work with http requests, and i dont have some jServer that i can connect to also I dont have xammp or other http server . I just want to store/read some data from mySQL server directly like i did with jSQl.
I don`t know if that`s possible, any help would be appreciated.
On a second note, i noticed that on my MEGA 2560 with a shield attached i have :
B4X:
If eth.InitializeDHCP(MacAddress) = False Then
Log("Error connecting to network.")
Return
Else
Log("Connected to network. My ip address: ", eth.LocalIp)
End If
B4X:
eth.Initialize(MacAddress,Array As Byte(192, 168,1, 126))
Log("IP= " ,eth.LocalIp)
Thank you.