Connecting Java to MySQL


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Connecting Java to MySQL

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    21

    Connecting Java to MySQL

    This may be more of a mysql question than a java question, but I will ask anyway.
    I have a TestMySQL class which goes through all the necessary steps to connect java to mysql, but I want to connect it to a database which is configured to be on localhost on my server. When writing php, I just use localhost as the server, but is there a way to access it from my computer using a java program such as this?

    Thanks

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    Just use localhost as the server in java then.

    This link is to an early program i've started. It connects to mysql on my machine as localhost. I would just paste the code section you need to see, but im at work and we dont have winzip on these computers.

    http://kff.dbspot.com/KFF.zip

  3. #3
    Join Date
    Oct 2004
    Posts
    21
    the mysql is not on my machine though. Its on a separate computer and set up on that one as localhost.

  4. #4
    Join Date
    Mar 2004
    Posts
    635
    so then you'll have to run your program from that server, unless they allow outside connections

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center