Tvd
Tvd

Reputation: 4601

MySQL : Connect locally using Java

I have a MySQL database and a java application using it thru JDBC. I want to distribute the application. I copied the DB to my application folder. I also have myconnectionj jar file included in the project.

How to create the url/connectionString to connect to the database along with the application instead of using server ? I want to connect like we do for Access files. We can distribute it with the application easily and use it. How to achieve the same with MySQL DB without using server.

Upvotes: 0

Views: 108

Answers (2)

Udo Held
Udo Held

Reputation: 12538

I'm not sure if there is a mysql-wrapper for such tests. AFAIK you need a running server.

If you need portability you should check file-databases like: H2, HyperSQL or SQLLite.

Upvotes: 0

Ernesto Campohermoso
Ernesto Campohermoso

Reputation: 7371

I don't know if MySQL can provide that flexibility. But exist other Databases which enable to you store the data in a file and port it across to clients. You can ckeck the following:

  1. Derby DB
  2. HSQL DB
  3. SQL Lite

Upvotes: 1

Related Questions