public class JRCatalog
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_TABLE
Indicates that the type of table is a table (not a view).
|
static int |
TYPE_VIEW
Indicates that the type of table is a view (not a table).
|
static int |
vDebug
Indicates to open the debug log.
|
static int |
vError
Indicates to open the error log.
|
static int |
vOff
Indicates to close the debug and error log.
|
Constructor and Description |
---|
JRCatalog()
The default construct.
|
Modifier and Type | Method and Description |
---|---|
void |
addConnection(ConnectionDesc connection)
Adds the specified connection to the catalog.
|
void |
addFileQuery(java.lang.String strName,
java.io.File flPath)
Adds the file query specified by the name and file to a catalog.
|
java.util.Vector |
addTableViews(java.lang.String strCatalogName,
java.lang.String schemaPattern,
java.lang.String tablePattern,
int iType)
Adds the file query specified by the name and file to a catalog.
|
void |
addWherePortion(java.lang.String strName,
java.lang.String strQueryName,
java.lang.String strSQL)
Adds the specified where portion to catalog.
|
void |
addWherePortion(java.lang.String strName,
java.lang.String strQueryName,
java.util.Vector vecGroups)
Adds the specified where portion to catalog and save catalog.
|
void |
closeCatalog()
Closes the catalog and release all resources.
|
void |
deleteConnection()
Deletes the connection from the catalog.
|
void |
deleteFileQuery(java.lang.String strName)
Deletes the specified file query in the catalog.
|
void |
deleteWherePortion(java.lang.String strName)
Removes the where portion by the specified name.
|
java.lang.String |
getCatName()
Gets the name of the catalog.
|
ConnectionDesc |
getConnectionDesc()
Gets the connection description.
|
java.lang.String |
getFileQuerySQL(java.lang.String strName)
Gets the file query SQL string.
|
java.lang.String |
getReportHome()
Gets the report home path where the report.ini and
other Logi Report system files exist.
|
java.lang.String |
getWherePortionsSQL(java.lang.String strName)
Gets the where portion by the specified name.
|
void |
loadCatalog()
Loads the catalog by the specified catalog name.
|
void |
modifyConnection(ConnectionDesc connection)
Modifies the connection according to the specified connection description.
|
void |
modifyConnection(ConnectionDesc connection,
boolean reconnect)
Modifies the connection according to the specified connection description.
|
void |
modifyUserInfo(java.lang.String strUserName,
java.lang.String strPassword)
Modifies the User and Password information according to the specified
connection description.
|
void |
modifyWherePortion(java.lang.String strName,
java.lang.String strQueryName,
java.lang.String strSQL)
Modifies the specified where portion.
|
void |
modifyWherePortion(java.lang.String strName,
java.lang.String strQueryName,
java.util.Vector vecGroups)
Modifies the specified where portion.
|
void |
newCatalog()
Creates a new catalog with the catalog name and save the catalog to file.
|
boolean |
removeSFDataSource(java.lang.String strName)
Removes a user data source for IBM Sanfrancisco.
|
void |
saveCatalog()
Saves the catalog to a file.
|
void |
saveCatalogAs(java.lang.String strCatName)
Saves the catalog to specified file.
|
void |
setCatName(java.lang.String catName)
Sets the name of the catalog.
|
void |
setCurrentDataSource(java.lang.String dataSourceName)
Sets the current DataSource.
|
boolean |
setLogFile(java.lang.String fileName)
Sets the log file.
|
void |
setReportHome(java.lang.String reportHome)
Sets the report home path where the report.ini and
other Logi Report system files exist.
|
void |
setShowInfoLevel(int level)
Enables/disables output error and debug message.
|
public static final int vOff
public static final int vDebug
public static final int vError
public static final int TYPE_TABLE
public static final int TYPE_VIEW
public java.lang.String getReportHome()
public void setReportHome(java.lang.String reportHome)
reportHome
- the home path where the report.ini and
other Logi Report system files exist.public void setCatName(java.lang.String catName)
catName
- the name of the catalog.public java.lang.String getCatName()
public void newCatalog() throws JRCatalogException
JRCatalogException
- if an error occursJRCatalogException.SYSTEM_INITIALIZE_ERROR
,
JRCatalogException.CAT_NAME_ERROR
,
JRCatalogException.CREATE_CAT_ERROR
,
JRCatalogException.SAVE_CAT_ERROR
public void loadCatalog() throws JRCatalogException
JRCatalogException
- if an error occursJRCatalogException.SYSTEM_INITIALIZE_ERROR
,
JRCatalogException.CAT_NAME_ERROR
,
JRCatalogException.LOAD_CAT_ERROR
public void saveCatalog() throws JRCatalogException
JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.SAVE_CAT_ERROR
public void saveCatalogAs(java.lang.String strCatName) throws JRCatalogException
JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.SAVE_CAT_ERROR
public void closeCatalog()
public void addWherePortion(java.lang.String strName, java.lang.String strQueryName, java.lang.String strSQL) throws JRCatalogException
strName,
- the name of where portion.strQueryName,
- the query name of where portion.strSQL,
- the where portion stringJRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.WHEREPORTION_NAME_ERROR
public void addWherePortion(java.lang.String strName, java.lang.String strQueryName, java.util.Vector vecGroups) throws JRCatalogException
strName,
- the name of where portion.strQueryName,
- the query name of where portion.vecGroups,
- the where portion structure.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.WHEREPORTION_NAME_ERROR
public void modifyWherePortion(java.lang.String strName, java.lang.String strQueryName, java.lang.String strSQL) throws JRCatalogException
strName,
- the name of where portion.strQueryName,
- the query name of where portion.strSQL,
- the where portion stringJRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.WHERE_PORTION_NOT_EXISTS
public void modifyWherePortion(java.lang.String strName, java.lang.String strQueryName, java.util.Vector vecGroups) throws JRCatalogException
strName,
- the name of where portion.strQueryName,
- the query name of where portion.vecGroups,
- the where portion structure.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.WHERE_PORTION_NOT_EXISTS
public void deleteWherePortion(java.lang.String strName) throws JRCatalogException
strName,
- the name of where portion.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.WHERE_PORTION_NOT_EXISTS
public java.lang.String getWherePortionsSQL(java.lang.String strName) throws JRCatalogException
nameOfWherePortion,
- the name of where portion.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.WHERE_PORTION_NOT_EXISTS
public void addFileQuery(java.lang.String strName, java.io.File flPath) throws JRCatalogException
strName,
- the name of file query.flPath,
- the sql file.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.NO_CONNECTION_ERROR
,
JRCatalogException.CREATE_FILEQUERY_FAILED
public java.util.Vector addTableViews(java.lang.String strCatalogName, java.lang.String schemaPattern, java.lang.String tablePattern, int iType) throws JRCatalogException
strCatalogName,
- the name of catalog.schemaPattern,
- the pattern of schema.tablePattern,
- the pattern of table.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.NO_CONNECTION_ERROR
,
JRCatalogException.INVALID_TABLETYPE
,
JRCatalogException.UNKNOWN_ERROR
,
JRCatalogException.CONNECTION_FAILURE_ERROR
,
JRCatalogException.CLOSE_CONNECTION_ERROR
public void deleteFileQuery(java.lang.String strName) throws JRCatalogException
strName,
- the name of file query.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.NO_CONNECTION_ERROR
,
JRCatalogException.CREATE_FILEQUERY_FAILED
public java.lang.String getFileQuerySQL(java.lang.String strName) throws JRCatalogException
strName,
- the name of file query.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.NO_CONNECTION_ERROR
,
JRCatalogException.FILEQUERY_NAME_ERROR
,
JRCatalogException.CREATE_FILEQUERY_FAILED
,
JRCatalogException.FILEQUERY_NOT_EXISTS
public boolean removeSFDataSource(java.lang.String strName) throws JRCatalogException
strName,
- the name of UDS;JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
public void addConnection(ConnectionDesc connection) throws JRCatalogException
connection,
- the connection description.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.ONE_CONNECTION
,
JRCatalogException.CONNECTION_FAILURE_ERROR
,
JRCatalogException.FILEQUERY_NOT_EXISTS
public void modifyConnection(ConnectionDesc connection) throws JRCatalogException
connection,
- the connection description.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.NO_CONNECTION_ERROR
,
JRCatalogException.CONNECTION_FAILURE_ERROR
public void modifyConnection(ConnectionDesc connection, boolean reconnect) throws JRCatalogException
connection,
- the connection description.reconnect,
- try to make a connection to the database and fetch connection information if it is true.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.NO_CONNECTION_ERROR
,
JRCatalogException.CONNECTION_FAILURE_ERROR
public void modifyUserInfo(java.lang.String strUserName, java.lang.String strPassword) throws JRCatalogException
connection,
- the connection description.JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.NO_CONNECTION_ERROR
,
JRCatalogException.CONNECTION_FAILURE_ERROR
public void deleteConnection() throws JRCatalogException
JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
,
JRCatalogException.NO_CONNECTION_ERROR
,
JRCatalogException.CONNECTION_FAILURE_ERROR
public ConnectionDesc getConnectionDesc() throws JRCatalogException
JRCatalogException
- if an error occursJRCatalogException.NO_CAT_ERROR
public void setShowInfoLevel(int level)
public boolean setLogFile(java.lang.String fileName)
fileName
- the log file name
LogFileName specifies where the debug, error and other information will go. LogFileName contains both the path and the file name. If no path is specified, the current path is used. If no file name is specified, the file logireport.log is used
public void setCurrentDataSource(java.lang.String dataSourceName)
dataSourceName
- the DataSource name
user can use this method to switch among the data sources. The default data source is named as "".