DBA > Job Interview Questions > DERBY Java Database FAQs

Standard Connections--Connecting to Databases in

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

Standard Connections--Connecting to Databases in the File System Within the System

The standard way to access databases is in the file system by specifying the path to the database, either absolute or relative to the system directory. In a client/server environment, this path is always on the server machine.

By default, you can connect to databases within the current system directory . To connect to databases within the current system, just specify the database name on the connection URL. For example, if your system directory contains a database called myDB, you can connect to that database with the following connection URL:

jdbc:derby:myDB
The full call within a Java program would be:
Connection conn =DriverManager.getConnection("jdbc:derby:myDB");

(Continued on next question...)

Other Job Interview Questions