Carven
Carven

Reputation: 15660

Native Database Support in Java?

Does Java have support for any form of databases natively? That is, does Java have a set of API or library that allows me to create and use databases such as MS Access or SQLite, etc?

It seems like I must download a third-party wrapper library or driver before I can use any database. IS there a native standard library in Java that allows me to do databases without third-party classes?

Upvotes: 1

Views: 2406

Answers (4)

bmargulies
bmargulies

Reputation: 100196

There are many 100% Java databases. Start with Apache Derby.

Obviously, if you want to talk to a database that is, itself, not written in Java, you'll have to use some sort of connector.

In many cases, for databases typically spoken to over a network (e.g. Oracle, mysql, postgresql) the connector is a 'type 4' JDBC driver, which is a slug of 100% Java code that implements the same network protocol as gets used for all other programming languages.

For embedded non-Java databases, 'some glue required'.

Upvotes: 1

Ryan Stewart
Ryan Stewart

Reputation: 128949

No. Java's database functionality (JDBC) is composed of a set of interfaces (plus a few utility classes) in the standard library and third-party implementations of those interfaces that let you connect to all the various databases out there. You'll have to find and use at least a driver library for any database you'd like to connect to.

Upvotes: 2

Jay Kominek
Jay Kominek

Reputation: 8783

The standard class library doesn't have any thing like that built in. See this answer for information on getting SQLite going with minimum fuss. That's as good as it's going to get, I'm afraid.

Upvotes: 0

jefflunt
jefflunt

Reputation: 33954

This link is a quick overview of them

  • JavaDB - a Java-based database
  • JDO - Java DataObject Objects - an abstraction for persistence
  • JDBC - Java Database Connectivity - which has drivers for many vendor DBs (MySQL, MSSQL, SQLite, etc.)

Upvotes: 1

Related Questions