|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.postgresql.pljava.management.Commands
public class Commands
This methods of this class are implementations of SQLJ commands.
SELECT sqlj.install_jar(<jar_url>, <jar_name>, ;<deploy>);
jar_url The URL that denotes the location of the jar that should be loaded jar_name This is the name by which this jar can be referenced once it has been loaded deploy True if the jar should be deployed according to a deployment descriptor
, false otherwise
SELECT sqlj.replace_jar(<jar_url>, <jar_name>, ;<redeploy>);
jar_url The URL that denotes the location of the jar that should be loaded jar_name The name of the jar to be replaced redeploy True if the old and new jar should be undeployed and deployed according to their respective deployment descriptors
, false otherwise
SELECT sqlj.remove_jar(<jar_name>, <undeploy>);
jar_name The name of the jar to be removed undeploy True if the jar should be undeployed according to its deployment descriptor
, false otherwise
SELECT sqlj.get_classpath(<schema>);
schema The name of the schema
SELECT sqlj.set_classpath(<schema>, <classpath>);
schema The name of the schema classpath The colon separated list of jar names
Constructor Summary | |
---|---|
Commands()
|
Method Summary | |
---|---|
static void |
addClassImages(java.sql.Connection conn,
int jarId,
java.lang.String urlString)
Reads the jar found at the specified URL and stores the entries in the jar_entry table. |
protected static void |
assertJarName(java.lang.String jarName)
Throws an exception if the given name cannot be used as the name of a jar. |
protected static void |
deployInstall(java.sql.Connection conn,
int jarId)
|
protected static void |
deployRemove(java.sql.Connection conn,
int jarId)
|
static java.lang.String |
getClassPath(java.lang.String schemaName)
Return the classpath that has been defined for the schema named schemaName
This method is exposed in SQL as sqlj.get_classpath(VARCHAR) . |
protected static SQLDeploymentDescriptor |
getDeploymentDescriptor(java.sql.Connection conn,
int jarId)
|
protected static int |
getJarId(java.sql.Connection conn,
java.lang.String jarName,
AclId[] ownerRet)
Returns the primary key identifier for the given Jar. |
protected static Oid |
getSchemaId(java.sql.Connection conn,
java.lang.String schemaName)
Returns the Oid for the given Schema. |
static void |
installJar(java.lang.String urlString,
java.lang.String jarName,
boolean deploy)
Installs a new Jar in the database jar repository under name jarName . |
static void |
removeJar(java.lang.String jarName,
boolean undeploy)
Removes the jar named jarName from the database jar
repository. |
static void |
replaceJar(java.lang.String urlString,
java.lang.String jarName,
boolean redeploy)
Replaces the image of jar named jarName in the database jar
repository. |
static void |
setClassPath(java.lang.String schemaName,
java.lang.String path)
Define the class path to use for Java functions, triggers, and procedures that are created in the schema named schemaName
This method is exposed in SQL as sqlj.set_classpath(VARCHAR, VARCHAR) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Commands()
Method Detail |
---|
public static void installJar(java.lang.String urlString, java.lang.String jarName, boolean deploy) throws java.sql.SQLException
jarName
.
Once installed classpaths can be defined that refrences this jar. This
method is exposed in SQL as
sqlj.install_jar(VARCHAR, VARCHAR, BOOLEAN)
.
urlString
- The location of the jar that will be installed.jarName
- The name by which the system will refer to this jar.deploy
- If set, execute install commands found in the deployment descriptor.
java.sql.SQLException
- if the jarName
contains characters that are
invalid or if the named jar already exists in the system.setClassPath(java.lang.String, java.lang.String)
public static void replaceJar(java.lang.String urlString, java.lang.String jarName, boolean redeploy) throws java.sql.SQLException
jarName
in the database jar
repository. This method is exposed in SQL as
sqlj.replace_jar(VARCHAR, VARCHAR, BOOLEAN)
.
urlString
- The location of the jar that will be installed.jarName
- The name by which the system referes this jar.redeploy
- If set, execute remove commands found in the deployment
descriptor of the old jar and install commands found in the deployment
descriptor of the new jar.
java.sql.SQLException
- if the named jar cannot be found in the repository.public static void removeJar(java.lang.String jarName, boolean undeploy) throws java.sql.SQLException
jarName
from the database jar
repository. Class path entries that references this jar will also be
removed (just the entry, not the whole path). This method is exposed in
SQL as sqlj.remove_jar(VARCHAR, BOOLEAN)
.
jarName
- The name by which the system referes this jar.undeploy
- If set, execute remove commands found in the deployment
descriptor of the jar.
java.sql.SQLException
- if the named jar cannot be found in the repository.public static void setClassPath(java.lang.String schemaName, java.lang.String path) throws java.sql.SQLException
schemaName
This method is exposed in SQL as sqlj.set_classpath(VARCHAR, VARCHAR)
.
schemaName
- Name of the schema for which this path is valid.path
- Colon separated list of names. Each name must denote the name
of a jar that is present in the jar repository.
java.sql.SQLException
- If no schema can be found with the givene name, or if one or
several names of the path denotes a nonexistant jar file.public static java.lang.String getClassPath(java.lang.String schemaName) throws java.sql.SQLException
schemaName
This method is exposed in SQL as sqlj.get_classpath(VARCHAR)
.
schemaName
- Name of the schema for which this path is valid.
null
if this schema has no classpath.
java.sql.SQLException
public static void addClassImages(java.sql.Connection conn, int jarId, java.lang.String urlString) throws java.sql.SQLException
Backend.addClassImages()
method in order to get the needed read
permission.
conn
- The connection to usejarId
- The id used for the foreign key to the
jar_repository tableurlString
- The URL
java.sql.SQLException
protected static void deployInstall(java.sql.Connection conn, int jarId) throws java.sql.SQLException
java.sql.SQLException
protected static void deployRemove(java.sql.Connection conn, int jarId) throws java.sql.SQLException
java.sql.SQLException
protected static void assertJarName(java.lang.String jarName) throws java.sql.SQLException
jarName
- The naem to check.
java.io.IOException
java.sql.SQLException
protected static int getJarId(java.sql.Connection conn, java.lang.String jarName, AclId[] ownerRet) throws java.sql.SQLException
conn
- The connection to use for the query.jarName
- The name of the jar.
-1
if no
such jar is found.
java.sql.SQLException
protected static SQLDeploymentDescriptor getDeploymentDescriptor(java.sql.Connection conn, int jarId) throws java.sql.SQLException
java.sql.SQLException
protected static Oid getSchemaId(java.sql.Connection conn, java.lang.String schemaName) throws java.sql.SQLException
conn
- The connection to use for the query.schemaName
- The name of the schema.
null
if no such
schema is found.
java.sql.SQLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |