Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-09-2008, 01:48 AM
Member
 
Join Date: Jan 2008
Posts: 5
nancyhung is on a distinguished road
connect JDBC to offline database
Hi,

I have MySQL Server 5.0 installed in computer C:/Program Files/MySQL/MySQL Server5.0/ and create a DB called "photo".

I use JAVA programming to connect MySQL database by the following code and succeed,

public class PhotoSQL {
private String driver="com.mysql.jdbc.Driver";
private String url="jdbc:mysql://localhost:3306/photo";
private String username="root";
private String password="12345";
.....
....
....
}


But, I also have a backup database "photo_bak" in D:/BackUp/

is it possible to connect to database table in D:/BackUp/ with no MySQL Server installed in D:/??
if possible, how to change the url path so that I can connect to database in D:/BackUp/ and get the data from it??

Thank you very much!!

Nancy
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-12-2008, 01:04 AM
Member
 
Join Date: Feb 2008
Posts: 2
rwynkoop@mail.win.org is on a distinguished road
MySQL runs as a service on your machine. The data base file is not accessed directly by java, but instead via this service.

Java can talk to a database using JDBC.

You might want to try over at MySQL Forums for information on how to use your database backup.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Java application to connect to a database coco Database 3 09-18-2008 05:07 PM
Using JDBC to connect to ORACLE database Java Tip Java Tips 0 02-10-2008 01:27 PM
Problem to connect Database Swamipsn NetBeans 1 08-07-2007 09:13 AM
Offline Web browser one198 New To Java 6 08-02-2007 05:54 PM
without restarting the websphere server i need to connect a newly created database satya Enterprise JavaBeans 4 06-05-2007 03:45 AM


All times are GMT +3. The time now is 01:25 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org