ReadMe - FrontBase JDBC Driver

  1. Requirements
  2. URL syntax
  3. Establishing a connection

1. Requirements

2. URL syntax

The URL syntax is as follows:

jdbc:frontbase:// <host info> [<arg list>]

<host info>          ::= <regular> | <cluster list>
<arg list>           ::= <user> | <user password> | <database password> | <session> | <system> | 
                         <isolation level> | <locking discipline> | <access mode> | <prepare statement> | <time outt>

<regular>            ::= host_name <database info>
<cluster list>       ::= <cluster member> {/<cluster member>}

<database info>      ::= /database_name | :port

<cluster member>     ::= database_name@host_name

<user>               ::= /user=user_name
<user password>      ::= /upasswd=user_password
<database password>  ::= /dbpasswd=database_password
<session>            ::= /session=session_id
<system>             ::= /system=system_user
<isolation level>    ::= /isolation=<isolation value>
<locking discipline> ::= /locking=<locking value>
<access mode>        ::= /readOnly=<access value>
<prepare statement>  ::= /pstmt=<prepare value>
<time out>           ::= /timeout=time out in minuts
<time zone>          ::= /tz=time zone

<isolation value>    ::= read_uncommitted | read_committed | repeatable_read | serializable | versioned
<locking value>      ::= pessimistic | deferred | optimistic
<access value>       ::= true | false
<prepare value>      ::= client | server

3. Establishing a connection

Requires that the driver has been installed and that classpaths have been set up correctly.

Example:

import java.sql.*;

public class Test {

    public static void main(String[] args) {
    
        // Registers driver.
        try {
            Class.forName("com.frontbase.jdbc.FBJDriver");
        } 
        catch ( Exception e ) {
                System.err.println("Unable to load driver");
                e.printStackTrace();
        }
        
        // The complete URL syntax is described above
        try {             
            String url = "jdbc:frontbase://host_name/database_name";
            String user = "username";
            String password = "password";
            
            Connection con = DriverManager.getConnection(url, user, password);
            
            Statement stmt  = con.createStatement();
            
            // Put your code here...
            
            stmt.close();
            con.close();
        } 
        catch( SQLException ex ) {
            System.err.println("SQLException: " + ex.getMessage());
            ex.printStackTrace();
        }
    }
}