Robert Valentino Well-Known Member Licensed User Longtime User Oct 4, 2020 #1 My first time at trying to connect to a MySQL database and I am trying this example: https://www.b4x.com/android/forum/threads/jdbcsql-directly-connect-to-remote-databases.84016/ And I keep getting No suitable driver I've tried using settings Private driver As String = "net.sourceforge.jtds.jdbc.Driver" '"com.mysql.jdbc.Driver" and still same thing. Boo hoo, why is this so hard.
My first time at trying to connect to a MySQL database and I am trying this example: https://www.b4x.com/android/forum/threads/jdbcsql-directly-connect-to-remote-databases.84016/ And I keep getting No suitable driver I've tried using settings Private driver As String = "net.sourceforge.jtds.jdbc.Driver" '"com.mysql.jdbc.Driver" and still same thing. Boo hoo, why is this so hard.
OliverA Expert Licensed User Longtime User Oct 5, 2020 #2 Robert Valentino said: "net.sourceforge.jtds.jdbc.Driver" Click to expand... That’s for connecting to MS SQL. Use Robert Valentino said: "com.mysql.jdbc.Driver" Click to expand... and connector/j to connect to MySQL. For 32 bit, you can use up to version 5.x and for 64 bit use the 8.x version. After downloading the proper .jar file for the driver, place it into you additional libraries folder and then include it via the #AdditionalJar directive. Link: MySQL :: Download Connector/J dev.mysql.com Note: Select platform independent version for Windows Upvote 0
Robert Valentino said: "net.sourceforge.jtds.jdbc.Driver" Click to expand... That’s for connecting to MS SQL. Use Robert Valentino said: "com.mysql.jdbc.Driver" Click to expand... and connector/j to connect to MySQL. For 32 bit, you can use up to version 5.x and for 64 bit use the 8.x version. After downloading the proper .jar file for the driver, place it into you additional libraries folder and then include it via the #AdditionalJar directive. Link: MySQL :: Download Connector/J dev.mysql.com Note: Select platform independent version for Windows
Robert Valentino Well-Known Member Licensed User Longtime User Oct 5, 2020 #3 I guess this is where I am really confused. I use FatCow as my hosting agent and they allow me to have a MySQL server. I trying to connect to their server using my Android device. Which connector would I choose? Upvote 0
I guess this is where I am really confused. I use FatCow as my hosting agent and they allow me to have a MySQL server. I trying to connect to their server using my Android device. Which connector would I choose?
OliverA Expert Licensed User Longtime User Oct 5, 2020 #4 Robert Valentino said: I use FatCow as my hosting agent Click to expand... Robert Valentino said: Which connector would I choose? Click to expand... 1) Most likely none, since I'm pretty sure that FatCow does not allow external access to the MySQL database (most hosts don't). If you want external access to a DB, you could a) go for a VPS or b) go for DB hosting (AWS, Azure, etc.) 2) Actually, with Android, you may need to stick with the 5.x drivers (I think the 8.x drivers will fail). Testing will validate or invalidate this answer. Upvote 0
Robert Valentino said: I use FatCow as my hosting agent Click to expand... Robert Valentino said: Which connector would I choose? Click to expand... 1) Most likely none, since I'm pretty sure that FatCow does not allow external access to the MySQL database (most hosts don't). If you want external access to a DB, you could a) go for a VPS or b) go for DB hosting (AWS, Azure, etc.) 2) Actually, with Android, you may need to stick with the 5.x drivers (I think the 8.x drivers will fail). Testing will validate or invalidate this answer.
Robert Valentino Well-Known Member Licensed User Longtime User Oct 5, 2020 #5 FatCow platform type is Debian Tried with those drivers and the driver requires minsdk of 26 (so I set min to 27 and target to 29) and still get these errors I believe I will take OliverA advice and try AWS (I believe it's free) Upvote 0
FatCow platform type is Debian Tried with those drivers and the driver requires minsdk of 26 (so I set min to 27 and target to 29) and still get these errors I believe I will take OliverA advice and try AWS (I believe it's free)
OliverA Expert Licensed User Longtime User Oct 5, 2020 #6 Robert Valentino said: I believe I will take OliverA advice and try AWS (I believe it's free) Click to expand... That will not solve your error message. Which versions of the connector have your tried? Upvote 0
Robert Valentino said: I believe I will take OliverA advice and try AWS (I believe it's free) Click to expand... That will not solve your error message. Which versions of the connector have your tried?
OliverA Expert Licensed User Longtime User Oct 5, 2020 #7 I just compiled using mysql-connector-java-5.1.49.jar and mysql-connector-java-5.1.49-bin.jar w/o the errors you are experiencing above. B4A: 10.0 Java JDK: OpenJDK 11.0.1 from B4X's site Windows: 10 Pro (2004) Manifest: <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/> Upvote 0
I just compiled using mysql-connector-java-5.1.49.jar and mysql-connector-java-5.1.49-bin.jar w/o the errors you are experiencing above. B4A: 10.0 Java JDK: OpenJDK 11.0.1 from B4X's site Windows: 10 Pro (2004) Manifest: <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
OliverA Expert Licensed User Longtime User Oct 5, 2020 #8 Using mysql-connector-java-8.0.21, I get your errors, but then I expected 8.x to fail (Android's Java - 1.7 - is getting a tad old for all the new Java stuff coming out). Note: Previously I did not mention that 8.x may fail. But that was an answer w/o coffee... Upvote 0
Using mysql-connector-java-8.0.21, I get your errors, but then I expected 8.x to fail (Android's Java - 1.7 - is getting a tad old for all the new Java stuff coming out). Note: Previously I did not mention that 8.x may fail. But that was an answer w/o coffee...
Bladimir Silva Toro Active Member Licensed User Longtime User Oct 5, 2020 #9 Hello @Robert Valentino The problem with most hosting is that they do not support remote connections to the databases that they include in their hosting packages. Check if your FatCow hosting supports remote connections to the MySQL database You can try on the website https://remotemysql.com/ create a MySQL database is free and allows remote connections. Do the tests with B4A it should work without any problem Upvote 0
Hello @Robert Valentino The problem with most hosting is that they do not support remote connections to the databases that they include in their hosting packages. Check if your FatCow hosting supports remote connections to the MySQL database You can try on the website https://remotemysql.com/ create a MySQL database is free and allows remote connections. Do the tests with B4A it should work without any problem
Robert Valentino Well-Known Member Licensed User Longtime User Oct 5, 2020 #10 From what I have read on Stackoverflow it is possible. Here is the PHP code that was generated: Code: <?php $link = mysql_connect('*me*.fatcowmysql.com', 'bbs', '*password*'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_select_db(bbs); ?> I think if I could figure out the right connectors I could get it to work. BUT I will look remotemysql.com I'm down for trying ANY Ideas. Thanks folks Upvote 0
From what I have read on Stackoverflow it is possible. Here is the PHP code that was generated: Code: <?php $link = mysql_connect('*me*.fatcowmysql.com', 'bbs', '*password*'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_select_db(bbs); ?> I think if I could figure out the right connectors I could get it to work. BUT I will look remotemysql.com I'm down for trying ANY Ideas. Thanks folks
Robert Valentino Well-Known Member Licensed User Longtime User Oct 5, 2020 #11 Not sure if this will work: http://www.helloandroid.com/tutorials/connecting-mysql-database But am going to give it a try if I can. Upvote 0
Not sure if this will work: http://www.helloandroid.com/tutorials/connecting-mysql-database But am going to give it a try if I can.
Bladimir Silva Toro Active Member Licensed User Longtime User Oct 5, 2020 #12 Hello @Robert Valentino You can check if your database supports remote connections for this follow these steps: 1. Download HeidiSQL at the following link: https://www.heidisql.com/download.php 2. Install on your PC - create a new connection 3. Write the data of your hosting the ip address, the username and password of your database 4. Click on Open if it connects is that your hosting does support remote connection I leave you the photos of the tests with the remotemysql.com hosting Do this with your FatCow hosting and tell me if you could connect. Upvote 0
Hello @Robert Valentino You can check if your database supports remote connections for this follow these steps: 1. Download HeidiSQL at the following link: https://www.heidisql.com/download.php 2. Install on your PC - create a new connection 3. Write the data of your hosting the ip address, the username and password of your database 4. Click on Open if it connects is that your hosting does support remote connection I leave you the photos of the tests with the remotemysql.com hosting Do this with your FatCow hosting and tell me if you could connect.
Bladimir Silva Toro Active Member Licensed User Longtime User Oct 5, 2020 #13 Robert Valentino said: Not sure if this will work: http://www.helloandroid.com/tutorials/connecting-mysql-database But am going to give it a try if I can. Click to expand... Try using HeidiSQL with remotemysql.com hosting Also try your FatCow hosting It alerts me if it connects successfully Upvote 0
Robert Valentino said: Not sure if this will work: http://www.helloandroid.com/tutorials/connecting-mysql-database But am going to give it a try if I can. Click to expand... Try using HeidiSQL with remotemysql.com hosting Also try your FatCow hosting It alerts me if it connects successfully
Bladimir Silva Toro Active Member Licensed User Longtime User Oct 5, 2020 #14 Hello @Robert Valentino Here is the example of JdbcSQL connected to a remote MySQL database, which is on the hosting http://www.remotemysql.com/ I leave the photos of the LOG in B4A and the data of the animals table Log B4A: Table Animals MySQL - HeidiSQL Write if you have any questions Attachments JdbcSQL Example RemoteMySQL.zip JdbcSQL Example RemoteMySQL.zip 8.2 KB · Views: 517 Upvote 0
Hello @Robert Valentino Here is the example of JdbcSQL connected to a remote MySQL database, which is on the hosting http://www.remotemysql.com/ I leave the photos of the LOG in B4A and the data of the animals table Log B4A: Table Animals MySQL - HeidiSQL Write if you have any questions
Robert Valentino Well-Known Member Licensed User Longtime User Oct 5, 2020 #15 HeidiSQL wouldn't work and it is because they do not allow it. I had it working using the example: https://www.b4x.com/android/forum/t...hp-mysql-server-xampp-with-b4a.48635/#content But after an hour or so they shut it down on me. I guess I should have realized that it was a problem when I couldn't upload a PHP had to upload it as a txt file and then rename it. But at least I have the code for something like this and have learned something in the process. They suggested https://www.ipage.com/vps-hosting but the small amount of money my app generates, cannot handle $20 bucks a month. Was trying the https://remotemysql.com/ that was suggested. But you have to take all these Surveys to be able to do anything. I guess I didn't answer the questions the way they wanted (I give out very little information to anyone - once bitten by ID theft, lesson learned) Will keep searching for a free remote SQL server Upvote 0
HeidiSQL wouldn't work and it is because they do not allow it. I had it working using the example: https://www.b4x.com/android/forum/t...hp-mysql-server-xampp-with-b4a.48635/#content But after an hour or so they shut it down on me. I guess I should have realized that it was a problem when I couldn't upload a PHP had to upload it as a txt file and then rename it. But at least I have the code for something like this and have learned something in the process. They suggested https://www.ipage.com/vps-hosting but the small amount of money my app generates, cannot handle $20 bucks a month. Was trying the https://remotemysql.com/ that was suggested. But you have to take all these Surveys to be able to do anything. I guess I didn't answer the questions the way they wanted (I give out very little information to anyone - once bitten by ID theft, lesson learned) Will keep searching for a free remote SQL server
Bladimir Silva Toro Active Member Licensed User Longtime User Oct 5, 2020 #16 Hello @Robert Valentino It will be very difficult to get free hosting that allows remote connections to the MySQL database. So then I recommend you connect by WebService, you must program in PHP on your hosting and to share data you must use the JSON format For this you must read OkhttpUtils2 Library https://www.b4x.com/android/forum/threads/b4x-okhttputils2-ihttputils2-httputils2-source-code.82632/ JSON library https://www.b4x.com/android/forum/threads/android-json-tutorial.6923 Upvote 0
Hello @Robert Valentino It will be very difficult to get free hosting that allows remote connections to the MySQL database. So then I recommend you connect by WebService, you must program in PHP on your hosting and to share data you must use the JSON format For this you must read OkhttpUtils2 Library https://www.b4x.com/android/forum/threads/b4x-okhttputils2-ihttputils2-httputils2-source-code.82632/ JSON library https://www.b4x.com/android/forum/threads/android-json-tutorial.6923
Robert Valentino Well-Known Member Licensed User Longtime User Oct 5, 2020 #17 I agree. I signed up for the remotemysql.com but can't find a way of uploading a php to it and haven't been able to connect using connectors. Boy, I am 70 so this stuff is like pulling the few real teeth I have. Think I would rather a poke in the eye with a sharp stick. Guess, I will have to try a site that charges very little. Upvote 0
I agree. I signed up for the remotemysql.com but can't find a way of uploading a php to it and haven't been able to connect using connectors. Boy, I am 70 so this stuff is like pulling the few real teeth I have. Think I would rather a poke in the eye with a sharp stick. Guess, I will have to try a site that charges very little.
Bladimir Silva Toro Active Member Licensed User Longtime User Oct 5, 2020 #18 Robert Valentino said: I agree. I signed up for the remotemysql.com but can't find a way of uploading a php to it and haven't been able to connect using connectors. Boy, I am 70 so this stuff is like pulling the few real teeth I have. Think I would rather a poke in the eye with a sharp stick. Guess, I will have to try a site that charges very little. Click to expand... Hello @Robert Valentino Look at the hosting remotemysql.com only offers the possibility of having a MySQL database that can be accessed remotely. Look at the example attached there is this for example how to make a SELECT query to the remote database. Attachments JdbcSQL Example RemoteMySQL.zip JdbcSQL Example RemoteMySQL.zip 8.2 KB · Views: 506 Upvote 0
Robert Valentino said: I agree. I signed up for the remotemysql.com but can't find a way of uploading a php to it and haven't been able to connect using connectors. Boy, I am 70 so this stuff is like pulling the few real teeth I have. Think I would rather a poke in the eye with a sharp stick. Guess, I will have to try a site that charges very little. Click to expand... Hello @Robert Valentino Look at the hosting remotemysql.com only offers the possibility of having a MySQL database that can be accessed remotely. Look at the example attached there is this for example how to make a SELECT query to the remote database.
yfleury Active Member Licensed User Longtime User Oct 5, 2020 #19 I have a server at home and I use jrdc2 server on it. My app make connection to jrdc2 sever and do everything on mysql database. It not so difficult to build it and it's very fast to transfer data from app to server or server to app. Cost 0$. Upvote 0
I have a server at home and I use jrdc2 server on it. My app make connection to jrdc2 sever and do everything on mysql database. It not so difficult to build it and it's very fast to transfer data from app to server or server to app. Cost 0$.
Robert Valentino Well-Known Member Licensed User Longtime User Oct 6, 2020 #20 A server at home wouldn't work for me. We are on satellite internet, slow as molasses going up hill on a winter day. Not to mention if it's raining too hard it's unavailable. As for SQL, I'm good at that. I just keeping getting in the unfiltered logs no connector. I've got to just find the right jar file. Calling it a day. Need to get ready for the Packer day. Wife has chores for me to do before game. Lol Upvote 0
A server at home wouldn't work for me. We are on satellite internet, slow as molasses going up hill on a winter day. Not to mention if it's raining too hard it's unavailable. As for SQL, I'm good at that. I just keeping getting in the unfiltered logs no connector. I've got to just find the right jar file. Calling it a day. Need to get ready for the Packer day. Wife has chores for me to do before game. Lol