org.apache.derbyDemo.vtis.core
Class VTIHelper

java.lang.Object
  extended by org.apache.derbyDemo.vtis.core.VTIHelper

public abstract class VTIHelper
extends java.lang.Object

VTI helper methods.


Field Summary
private static boolean DEBUG
           
 
Constructor Summary
VTIHelper()
           
 
Method Summary
static java.lang.String doubleQuote(java.lang.String name)
           Double-quote a name.
static void dropObject(java.lang.String objectType, java.lang.String objectName, boolean objectIfMissing)
           Execute a DDL statement to drop an object if it exists.
static void executeDDL(java.lang.String ddl)
           Execute a DDL statement
static java.sql.Connection getLocalConnection()
           Get the connection to the local database.
private static java.lang.String mapType(java.lang.Class javaType)
           Map a Java type to a SQL type.
static void print(java.lang.String text)
           Debug helper method to print a diagnostic.
static void registerVTI(java.lang.reflect.Method method, java.lang.String[] columnNames, java.lang.String[] columnTypes, boolean readsSqlData)
           Register a VTI.
static void unregisterVTI(java.lang.reflect.Method method)
           Unregister a VTI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

VTIHelper

public VTIHelper()
Method Detail

unregisterVTI

public static void unregisterVTI(java.lang.reflect.Method method)
                          throws java.sql.SQLException

Unregister a VTI.

Throws:
java.sql.SQLException

registerVTI

public static void registerVTI(java.lang.reflect.Method method,
                               java.lang.String[] columnNames,
                               java.lang.String[] columnTypes,
                               boolean readsSqlData)
                        throws java.lang.Exception

Register a VTI.

Throws:
java.lang.Exception

dropObject

public static void dropObject(java.lang.String objectType,
                              java.lang.String objectName,
                              boolean objectIfMissing)
                       throws java.sql.SQLException

Execute a DDL statement to drop an object if it exists. Swallow exceptions.

Throws:
java.sql.SQLException

executeDDL

public static void executeDDL(java.lang.String ddl)
                       throws java.sql.SQLException

Execute a DDL statement

Throws:
java.sql.SQLException

doubleQuote

public static java.lang.String doubleQuote(java.lang.String name)

Double-quote a name.


print

public static void print(java.lang.String text)

Debug helper method to print a diagnostic.


getLocalConnection

public static java.sql.Connection getLocalConnection()
                                              throws java.sql.SQLException

Get the connection to the local database.

Throws:
java.sql.SQLException

mapType

private static java.lang.String mapType(java.lang.Class javaType)
                                 throws java.lang.Exception

Map a Java type to a SQL type.

Throws:
java.lang.Exception