• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC Code error

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :



 
Ranch Hand
Posts: 624
9
BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure the database is started?
Looks like database port is not listening.
What is output of
 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 624
9
BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic