aspose file tools
The moose likes JDBC and the fly likes DB on Local Files System Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "DB on Local Files System" Watch "DB on Local Files System" New topic
Author

DB on Local Files System

Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Hi, I am just starting with JDBC (trying to learn) and am not in a situation where my DB cannot be on a server, so I have it stored on my local files system.
Will it be accessed the same way? Or where do I need to start? Any information would be greatly appreciated.
Restatement - How do I make the URL point to a local file and connect to it??
Thanks

------------------
Happy Coding,
Gregg Bolinger
[This message has been edited by Gregg Bolinger (edited October 26, 2001).]
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
If you want to get started with JDBC, you'll have to have some sort of database. I'll assume that there's no budget for the likes of Oracle or even SQL Server. While you could use an embedded database (e.g. HypersonicSQL, I would still recommend you start with a "real" database server. The good news is that nothing stops you from running the server on your very own machine! Well, nothing except a possible lack of memory, that is. Try MySQL for starters, or PostgreSQL.
- Peter
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Thanks Peter.
------------------
Happy Coding,
Gregg Bolinger
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Ok, I installed MySQL and started running the service. Do I still connect with the url in the fashon jdbc dbc:mysql or does odbc need to be something different.
Sorry if these questions seem elementary and if I need to read something that will help, please point me in the right direction.
Thanks

------------------
Happy Coding,
Gregg Bolinger
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
No. You'll only find a jdbc dbc: URL if you're using the JDBC-ODBC bridge. With MySQL, you don't need a bridge - rather, fast and efficient JDBC straight to the database. Grab one of the JDBC drivers from the contributed software page.
For instance, if you use this one, then you can connect to your database usingWhere "databasename" is the name you chose for your database.
- Peter

[This message has been edited by Peter den Haan (edited October 26, 2001).]
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Peter, Thanks a million. I have one more question if you don't mind. How is it that using the Driver you suggestion faster than using the ODBC? Isn't it just replacing one driver with another? Is it truly a straight shot to the Database? And, what size will a database need to reach before I really tell a difference in speed?
Thanks again.

------------------
Happy Coding,
Gregg Bolinger
zou xiao fei
Greenhorn

Joined: Oct 26, 2001
Posts: 9
hi,
the codes upstair use a type 4 jdbc driver which mean it's fully made of pure java.The way of using jdbc-odbc bridge means access dbs via type 1.
You can know more from sun jdbc page or just search in ranch
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: DB on Local Files System
 
Similar Threads
access to database
Tab Key in JApplet and JtextField
Subdomain question
Tutorial/Review of Wicket Online
Dos Shell in JAVA