1

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?

jww
  • 97,681
  • 90
  • 411
  • 885
Carven
  • 14,988
  • 29
  • 118
  • 161

4 Answers4

2

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.

Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199
1

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.)
jefflunt
  • 33,527
  • 7
  • 88
  • 126
1

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'.

bmargulies
  • 97,814
  • 39
  • 186
  • 310
0

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.

Community
  • 1
  • 1
Jay Kominek
  • 8,674
  • 1
  • 34
  • 51