Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what databases can be used with java?

I am doing an undergrad final project, and need to justify my choice of MySQL for the database element of my project. Truth is, it's the only one I can really use, and hence I went for it.

What other database systems could I have used? Any advantages and disadvantages of these over MySQL?

like image 323
aadersh patel Avatar asked Mar 21 '10 18:03

aadersh patel


People also ask

What database is best for Java?

Oracle. Oracle is the most popular RDBMS written in assembly language C, C++, and Java.

Can we use database in Java?

As a developer, you can use JDBC to interact with a database from within a Java program. JDBC acts as a bridge from your code to the database, as shown in Figure 1. Figure 1. JDBC connects Java programs to databases.

How many types of databases are there in Java?

There are two kinds of distributed database, viz. homogenous and heterogeneous.

Which SQL is used for Java?

The JDBC operations are carried out through the " Connection ", " Statement " and " ResultSet " objects (defined in package java. sql ).


2 Answers

In fact, you can use every database which is accessible through a JDBC driver. Almost all self-respected RDBMS vendors provides a fullworthy JDBC driver for download at their homepage. Just Google "[vendorname] jdbc driver download" to find it. Here's an overview:

  • MySQL JDBC driver
  • PostgreSQL JDBC driver (note: older versions doesn't support generated keys).
  • Oracle JDBC driver (note: older versions doesn't support generated keys).
  • MSSQL JDBC driver (or performancewise better, the jTDS JDBC driver)
  • DB2 JDBC driver is hard to find in IBM's online forest, but it's usually already included in the /java folder of the DB2 installation.

This way you can use the JDBC API transparently to access either of the databases.

As to which database to choose, just look at the features, robustness, performance, etc the RDBMS provides and the budget you have -if it isn't freeware. I myself tend to prefer PostgreSQL.

Instead of a fullfledged database server, you can also consider an embedded Javabased database, such as Sun Oracle JavaDB, Apache Derby, HSQLDB or SQLite, each which are of course accessible through the JDBC API the usual way.

like image 77
BalusC Avatar answered Oct 11 '22 13:10

BalusC


You can use any relational database that has a JDBC driver. These would include PostgreSQL, Hypersonic SQL, MySQL, SQLLite on the free side and Oracle, MS SQL Server, and others on the paid side.

The biggest advantage accrued to MySQL in your case is that it's free and you know it. That's enough to make it suitable for what you want to accomplish.

like image 42
duffymo Avatar answered Oct 11 '22 13:10

duffymo