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

JDBC Code error

 
mert ozkaya
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am very new to JDBC programming.
I am using Mac OS X and trying get the following code run. I have already installed mysql into my machine. However, when I compiled and run the code, I got the error that I have given below the code. Can you please help me on finding out the reason for this error?

Code is :



 
Tapas Chand
Ranch Hand
Posts: 583
8
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the database is started?
Looks like database port is not listening.
What is output of
 
Tim Cooke
Sheriff
Pie
Posts: 3210
142
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also please BeForthrightWhenCrossPostingToOtherSites. We don't mind if you cross post to other sites, but we do ask that you tell us you've done so.

http://www.javaprogrammingforums.com/jdbc-databases/45128-jdbc-code-error.html
 
mert ozkaya
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Sorry for the cross posting - will delete the other.

I think that I have resolved the problem. The default port is 3307- not 3306. When I have made the regarding change, it seems that I got the code working.

Thanks.
 
Tapas Chand
Ranch Hand
Posts: 583
8
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good job.
But what about the blank string in password?
I thought we need to pass null instead of blank string for an user having no password.
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mert ozkaya wrote:

I think that I have resolved the problem. The default port is 3307- not 3306. When I have made the regarding change, it seems that I got the code working.

Thanks.


MySQL default port is 3306. Unless you have changed it to 3307, the port should have been 3306.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic