org.apache.derby.iapi.db
Class Factory

java.lang.Object
  extended byorg.apache.derby.iapi.db.Factory

public class Factory
extends java.lang.Object

Callers of these methods must be within the context of a Cloudscape statement execution otherwise a SQLException will be thrown.
There are two basic ways to call these methods.

  1. Within a SQL statement.
    		-- checkpoint the database
    		CALL org.apache.derby.iapi.db.Factory::
    				getDatabaseOfConnection().checkpoint();
      
  2. In a server-side JDBC method.
    		import org.apache.derby.iapi.db.*;
    
    		...
    
    	// checkpoint the database
    	    Database db = Factory.getDatabaseOfConnection();
    		db.checkpoint();
    
      
This class can only be used within an SQL-J statement, a Java procedure or a server side Java method.

This class can be accessed using the class alias FACTORY in SQL-J statements.

IBM Corp. reserves the right to change, rename, or remove this interface at any time.


Constructor Summary
Factory()
           
 
Method Summary
static Database getDatabaseOfConnection()
           Returns the Database object associated with the current connection.
static TriggerExecutionContext getTriggerExecutionContext()
          Get the TriggerExecutionContext for the current connection of the connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Factory

public Factory()
Method Detail

getDatabaseOfConnection

public static Database getDatabaseOfConnection()
                                        throws java.sql.SQLException

Returns the Database object associated with the current connection.

Throws:
java.sql.SQLException - Not in a connection context.

getTriggerExecutionContext

public static TriggerExecutionContext getTriggerExecutionContext()
                                                          throws java.sql.SQLException
Get the TriggerExecutionContext for the current connection of the connection.

Returns:
the TriggerExecutionContext if called from the context of a trigger; otherwise, null.
Throws:
java.sql.SQLException - Not in a connection or trigger context.


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.