Top Description Constructors Methods
org.apache.derby.iapi.db

public Class Factory

extends Object
Class Inheritance
Imports
org.apache.derby.iapi.services.monitor.Monitor, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, .ConnectionUtil, java.sql.SQLException

Callers of these methods must be within the context of a Derby 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.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Database

Returns:

the Database object associated with the current connection
getDatabaseOfConnection
()

Returns the Database object associated with the current connection.

public static TriggerExecutionContext

Returns:

the TriggerExecutionContext if called from the context of a trigger; otherwise, null.
getTriggerExecutionContext
()

Get the TriggerExecutionContext for the current connection of the connection.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Factoryback to summary
public Factory()

Method Detail

getDatabaseOfConnectionback to summary
public static Database getDatabaseOfConnection() throws SQLException

Returns the Database object associated with the current connection.

Returns:Database

the Database object associated with the current connection

Exceptions
SQLException:
Not in a connection context.
getTriggerExecutionContextback to summary
public static TriggerExecutionContext getTriggerExecutionContext() throws SQLException

Get the TriggerExecutionContext for the current connection of the connection.

Returns:TriggerExecutionContext

the TriggerExecutionContext if called from the context of a trigger; otherwise, null.

Exceptions
SQLException:
Not in a connection or trigger context.