com.jenkov.mrpersister.itf
Class Database

java.lang.Object
  extended by com.jenkov.mrpersister.itf.Database

public class Database
extends java.lang.Object

Signals the type of database a given IPersistenceConfiguration is targeted against. The database type can be used to avoid calling JDBC methods that the given database does not implement, or implements slightly differently than other databases etc.

Author:
Jakob Jenkov - Copyright 2005 Jenkov Development

Field Summary
static Database DAFFODIL
           
static Database DEFAULT
           
static Database DERBY
           
static Database FIREBIRD
           
static Database H2
           
static Database HSQLDB
           
protected  boolean isPreparedStatementParameterCountSupported
           
protected  boolean isPrepareStatementStatement_RETURN_GENERATED_KEYS_supported
           
protected  boolean isResultSetGetRowSupported
           
static Database MYSQL
           
protected  java.lang.String name
           
static Database POSTGRESQL
           
 
Constructor Summary
Database(java.lang.String name, boolean preparedStatementParameterCountSupported, boolean prepareStatementStatement_RETURN_GENERATED_KEYS_supported, boolean resultSetGetRowSupported)
           
 
Method Summary
static Database determineDatabase(java.sql.Connection connection)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getName()
           
 boolean isPreparedStatementParameterCountSupported()
           
 boolean isPrepareStatementStatement_RETURN_GENERATED_KEYS_supported()
           
 boolean isResultSetGetRowSupported()
           
static void main(java.lang.String[] args)
           
static void setDatabaseOnConfiguration(IPersistenceConfiguration configuration, java.sql.Connection connection)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final Database DEFAULT

DAFFODIL

public static final Database DAFFODIL

DERBY

public static final Database DERBY

HSQLDB

public static final Database HSQLDB

H2

public static final Database H2

MYSQL

public static final Database MYSQL

POSTGRESQL

public static final Database POSTGRESQL

FIREBIRD

public static final Database FIREBIRD

name

protected java.lang.String name

isPreparedStatementParameterCountSupported

protected boolean isPreparedStatementParameterCountSupported

isPrepareStatementStatement_RETURN_GENERATED_KEYS_supported

protected boolean isPrepareStatementStatement_RETURN_GENERATED_KEYS_supported

isResultSetGetRowSupported

protected boolean isResultSetGetRowSupported
Constructor Detail

Database

public Database(java.lang.String name,
                boolean preparedStatementParameterCountSupported,
                boolean prepareStatementStatement_RETURN_GENERATED_KEYS_supported,
                boolean resultSetGetRowSupported)
Method Detail

getName

public java.lang.String getName()

isPreparedStatementParameterCountSupported

public boolean isPreparedStatementParameterCountSupported()

isPrepareStatementStatement_RETURN_GENERATED_KEYS_supported

public boolean isPrepareStatementStatement_RETURN_GENERATED_KEYS_supported()

isResultSetGetRowSupported

public boolean isResultSetGetRowSupported()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

setDatabaseOnConfiguration

public static void setDatabaseOnConfiguration(IPersistenceConfiguration configuration,
                                              java.sql.Connection connection)

determineDatabase

public static Database determineDatabase(java.sql.Connection connection)

main

public static void main(java.lang.String[] args)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException