This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Transfer Learning for Natural Language Processing (MEAP) and have Paul Azunre on-line!
See this thread for details.
Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!

David Mesman

Greenhorn
+ Follow
since Jun 28, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David Mesman

I'm sorry, I'm totally new to making android apps. What is logcat? And where do I find it?
3 years ago

David Mesman wrote:I'm gonna try your solution, but if I get this working it is okay too.


By using your solution, there are no errors in Android Studio. But as soon as I try to start the app from my cellphone, it stops right away with the message "[appname] has stopped".
So no I am gonna try the HTTPClient. Which still doesn't work. (See one of my previous replies)
3 years ago

Ron McLeod wrote:I think a better solution would be to develop a simple HTTP/JSON based protocol for communications between the application and the data source, rather than connecting to the database server directly over a possibly unreliable and insecure wireless network.



I tried this as well. But for that I need some other jar files. I downloaded the HTTPClient java package from apache.org.
Here is my full code:


This is a link to a screenshot of my project tree with the httpclient folder:
screenshot

I'm gonna try your solution, but if I get this working it is okay too.
3 years ago
I got an earlier version of jdbc (4-2.0) and still get the same error. I honestly don't know what to do.
3 years ago

Dave Tolls wrote:Android's happy with Java 7 compilations, from what I've seen on Android Studio.

You need to find a version of the driver that's been compiled pre-8.



I don't really understand. I tried googling for jdbc java pre-8 but all I got were unclear results. So do you have a link or something?
3 years ago
Hello all, again! I am making a android app to connect with a sql database (online). I added mysql-connector-java-5.1.39-bin.jar as libary in Android Studio and wrote the basic connect function:

The error I get is:

Thanks in advance!
3 years ago
I got it to work somehow. I placed the function after the variable was initialised. Thanks for the help, and see you at the next problem! :p
3 years ago
I've made the table with the Netbeans pallete Swing controls.
It is declared, but a value is never asigned to the variable siteTable. I can enter rows in it with a GUI editor and that works while the variable is still empty (I tested it with a JOptionPane  with siteTable in it). It is declared like this:

So there is some sort of value, but no string or something "tangible".
3 years ago

Which line do you suffer the Exception on? That will enable you to work out whether siteTable or the returned model is equal to null.


Line 2 in the code part I submitted.
3 years ago
Hello again! I'm still working on my database application. I want to output the rows in my database table in a JTable, but the getModel() function returns a nullpointerexception. I know that this means the value returned is empty/null. I just don't know how to fix it. Here is the testfunction to add a row:

The variable siteTable is declared like this:


Thanks in advance!
3 years ago
Thanks Dave! That did the trick! The topic is now closed! Thanks for all the answers!
I got that one already! It worked fine with my local database (xampp) without registering the class. I'll try to register the class and see what happens! Where do i place this line ?
Hello everyone, I just started on an program/app to connect to an online database! I found some stuff online on how to do it. The problem is that java can't find the driver for my online database (sql6.freedatabase.com is the host i'm using). Is there a standard driver for online databases for java or do I need something specific? Here is a part of my code that should connect with the database:

The error that I get is: "No suitable driver found for jdbc:mysql:sql6.freesqldatabase.com".
Thanks in advance!