0

I have found out, from multiple sources, that object serialization is primarily for storing objects so that they could be sent across a network, to be remade. It even has to be tested: http://www.ibm.com/developerworks/library/j-serialtest/index.html . As an alternative, I have decided to use relational databases. The only problem is, if I rely on relational databases to store data, must I ask any users of my program to install or configure anything? //Forgive me: I have no prior experience with databases.

Also, I have heard of JavaDB (my Java textbook is calling it a version of Apache Derby). Is it a collection of relational database management systems (RDBMSs)? If the answer is "yes", what RDBMSs are included with JavaDB?

0

3 Answers 3

3

Apache Derby is, according to wikipedia.

a full-functioned relational embedded database-engine, supporting JDBC and SQL as programming APIs. It uses IBM DB2 SQL syntax.

What I think you're thinking of is JDBC, a vendor independent way to access databases from within Java.

Sign up to request clarification or add additional context in comments.

3 Comments

I am. By the way, does JavaDB leave any files on the computer that have the name in them? I have the latest version of Java 7 on my computer (I am typing java -version from the Command Prompt, and it is returning java version "1.7.0._21". According to this source, docs.oracle.com/javase/tutorial/jdbc/basics/… , JavaDB is supposed to already be on my computer with the drivers, which I cannot seem to find. I don't know if these, oracle.com/technetwork/database/enterprise-edition/… , are the drivers I am supposed to have.)
Add this jar to your classpath and your driver will be found within.
That's it for configuration.
2

Derby is one of many relational databases available to you. Others are Oracle, SQL Server, MySQL, PostgreSQL, and Hypersonic SQL.

Some are open source (MySQL, PostgreSQL, Hypersonic SQL, SQL Lite); others require a license (Oracle, SQL Server).

Some require installation (MySQL, PostgreSQL, Oracle, SQL Server); others do not (SQL Lite, Derby, Hypersonic SQL).

Java interacts with all databases using JDBC. You get a JAR of classes from the vendor that implement the interfaces in the java.sql package for that particular database.

3 Comments

No JDBC driver requires installation. You need only put the relevant jar(s) on your classpath.
What would I have to do to use SQL server from Java (ODBC Data Source Administrator is telling me that it could find the drivers for only the SQL Server)?
You would not use ODBC. Java JDBC drivers should be 100% Java; no ODBC needed. You would just download the JDBC driver JAR and put it in the CLASSPATH of your app.
1

I lot depends on what it is you want to achieve with the database. If the database is only ever going to be connected to by the user locally (on there machine), then you may prefer a single user database system.

You can then included the database engine as part of your general deployment as most don't need to be "installed" or "configured" and are simply started by using a specialized JDBC connection.

Take a look at

Which are both pure Java databases that support the concept of a single user access, but can be configured as standalone database severs if you wish...

2 Comments

I guess I should have provided a better explanation of what I need the database for. I am making an arithmetic game, have decided to store the gameplay results to a database. This database will, at first, be accessible only from that person's computer, and will be used to generate data regarding their completion times and their accuracy. (I might even use it for keeping and tracking achievements, kinda like XBOX Live....)
The good thing about JDBC is that you could start out with a single user database (as those mentioned) and when you ready, replace it with a multi user database (located on a remote server) and, other then the connection, get away with little code changes...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.