Results 1 to 2 of 2
Thread: connect JDBC to offline database
- 04-08-2008, 11:48 PM #1
Member
- Join Date
- Jan 2008
- Posts
- 5
- Rep Power
- 0
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
- 04-11-2008, 11:04 PM #2
Member
- Join Date
- Feb 2008
- Posts
- 2
- Rep Power
- 0
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.
Similar Threads
-
Help with Java application to connect to a database
By coco in forum JDBCReplies: 3Last Post: 09-18-2008, 03:07 PM -
Using JDBC to connect to ORACLE database
By Java Tip in forum Java TipReplies: 0Last Post: 02-10-2008, 11:27 AM -
Problem to connect Database
By Swamipsn in forum NetBeansReplies: 1Last Post: 08-07-2007, 07:13 AM -
Offline Web browser
By one198 in forum New To JavaReplies: 6Last Post: 08-02-2007, 03:54 PM -
without restarting the websphere server i need to connect a newly created database
By satya in forum Enterprise JavaBeans (EJB)Replies: 4Last Post: 06-05-2007, 01:45 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks