Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Failed communicate with MYSQL Database

 
gah hon
Greenhorn
Posts: 26
C++ Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At previous posts, I was questioning about upload the photo file into Amazon S3 and retrieve the file URL to display on the screen.
Now this assignment is upload the file name and file description into the database. However, I hit some error during the execution.

SQLException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
SQLState: 08S01
VendorError: 0
java.lang.NullPointerException

I am using MYSQL Workbench to connect RDS Amazon.
I had create one new database named ("kwongDB"), connection named ("COS80001"), in my MYSQL Workbench.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is this code in a JSP? That's a bad practice from over 14 years ago. It's time to start writing professional code where the Java code is in Java classes where it belongs.
 
gah hon
Greenhorn
Posts: 26
C++ Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Why is this code in a JSP? That's a bad practice from over 14 years ago. It's time to start writing professional code where the Java code is in Java classes where it belongs.


I am just follow the example and tutorials provided from my tutor. As she did mentioned that could write the java code into java file, or in the JSP file. So I will do in two versions, but before that,
I always complete one version before I go for another version. Therefore, I could gain the knowledge from both sides.
Could you please focus on the topic, to solve the issue? Until now, I am still have no idea what's going on, even though I check around the webs regarding the issues.
Thanks for advance. =]
 
Paul Clapham
Sheriff
Posts: 21572
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The message seems to suggest that your code isn't connecting to the server. So either the server isn't running on the same computer where that code is running (you asked to connect to "localhost") or there's some firewall or other network activity preventing your code from connecting to the server.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic