Dudley Porto

Greenhorn
+ Follow
since Feb 19, 2020
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 Dudley Porto

Hi,
I'm learning by building an app in Android Studio. I have a MYSQL server running on a linux VM. I'm trying to test registering a 'user', but I'm receiving the following error:

I/System.out: ERROR WHEN CREATING USER: Attempt to invoke interface method 'java.sql.ResultSet java.sql.Statement.executeQuery(java.lang.String)' on a null object reference
W/System.err: java.lang.NullPointerException: Attempt to invoke interface method 'java.sql.ResultSet java.sql.Statement.executeQuery(java.lang.String)' on a null object reference
       at Database2.register(Database2.java:45)
       at Register$1.onClick(Register.java:41)
       at android.view.View.performClick(View.java:7125)
       at android.view.View.performClickInternal(View.java:7102)
       at android.view.View.access$3500(View.java:801)
       at android.view.View$PerformClick.run(View.java:27336)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7356)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)


Database class

Register class


Some things I have checked and believe are true:
The port is indeed 3306.
The IP is correct and so is the URL.

Any guidance is appreciated, thank you.

3 months ago