Reputation: 795
I am planning an app that needs to connect to a MySQL database. Can I use JDBC in my Codename One project and expect it to work in runtime?
If Codename One does not support JDBC, could I implement a connection to MySQL using the native code (Objective-C) generated by Codename One?
Then if that is not possible, could I connect my Codename One project to a php script that runs on the server next to the MySQL database?
Upvotes: 2
Views: 989
Reputation: 52770
You can only connect to a server using a REST API or similar. JDBC will not pass thru the bytecode translation process and none of the JDBC drivers were designed for unreliable mobile device network connectivity.
Regardless its pretty unsafe to expose your database to the wireless network.
Just to add to this there is this new post covering connectivity to mysql in the backend: https://www.codenameone.com/blog/connecting-to-a-mysql-database.html
Upvotes: 1