public class Java2DBProcessorHelper extends Object
Constructor and Description |
---|
Java2DBProcessorHelper(DeploymentContext ctx)
Creates a new instance of Java2DBProcessorHelper.
|
Java2DBProcessorHelper(String appName)
Creates a new instance of Java2DBProcessorHelper to be used to execute SQL
statements only.
|
Modifier and Type | Method and Description |
---|---|
void |
createOrDropTablesInDB(boolean create,
String type)
Iterate over all "create" or "drop" ddl files and execute them.
|
void |
executeDDLs(File f,
Statement sql)
Open a DDL file and execute each line as a SQL statement.
|
boolean |
executeDDLStatement(File fileName,
String resourceName)
Get the ddl files eventually executed
against the database.
|
boolean |
executeDDLStatement(String fileNamePrefix,
String resourceName)
Get the DDL file and execute the statements.
|
String |
getAppRegisteredName() |
String |
getCreateJdbcFileName(String bundleName)
Returns createJdbcFileName
|
boolean |
getCreateTables(boolean param)
Create tables only on deploy, and only if the CLI options cliCreateTables or
cliDropAndCreateTables are not set to false.
|
boolean |
getCreateTables(String bundleName)
Calculate createTables value based on the parameter stored on deploy
|
File |
getDDLFile(String fileName,
boolean deploy)
Read the ddl file from the disk location.
|
static String |
getDDLNamePrefix(Object info)
Returns name prefix for DDL files extracted from the info instance by the
Sun-specific code.
|
String |
getDeployedLocation() |
String |
getDropJdbcFileName(String bundleName)
Returns dropJdbcFileName
|
boolean |
getDropTables(boolean param)
Drop tables on undeploy and redeploy, if the corresponding CLI options
cliDropAndCreateTables (for redeploy) or cliDropTables (for undeploy) are
not set to false.
|
boolean |
getDropTables(String bundleName)
Calculate dropTables value based on the parameter stored on deploy
|
String |
getGeneratedLocation(String bundleName)
Returns appGeneratedLocation or user defined value if the latter is specified
|
String |
getI18NMessage(String errorCode)
Get the localized message for the error code.
|
String |
getI18NMessage(String errorCode,
String regName,
String fileName,
Throwable ex)
Get a generic localized message.
|
String |
getJndiName(String bundleName)
Returns jndiName
|
boolean |
hasDeployCliOverrides() |
boolean |
hasUndeployCliOverrides() |
void |
init()
Initializes the rest of the settings
|
void |
logI18NWarnMessage(String errorCode,
String regName,
String fileName,
Throwable ex)
Provide a generic warning message to the user.
|
void |
setCreateJdbcFileName(String createJdbcFileName,
String bundleName)
Sets createJdbcFileName
|
void |
setCreateTablesValue(boolean createTablesValue,
String bundleName)
Store user defined value for create tables for future reference.
|
void |
setDropJdbcFileName(String dropJdbcFileName,
String bundleName)
Sets dropJdbcFileName
|
void |
setDropTablesValue(boolean dropTablesValue,
String bundleName)
Store user defined value for drop tables for future reference.
|
void |
setGeneratedLocation(String generatedLocation,
String bundleName)
Sets the substitute for the internal location of the generated files
|
void |
setJndiName(String jndiName,
String bundleName)
Sets jndiName
|
void |
setProcessorType(String processorType,
String bundleName)
Sets this processor type
|
static void |
warnUser(ActionReport report,
String msg)
Provide a warning message to the user.
|
public Java2DBProcessorHelper(String appName)
appName
- the name used for reporting purposespublic Java2DBProcessorHelper(DeploymentContext ctx)
ctx
- the deployment context object.public void init()
public void createOrDropTablesInDB(boolean create, String type)
public File getDDLFile(String fileName, boolean deploy)
fileName
- the string name of the file.deploy
- true if this event results in creating tables.public void executeDDLs(File f, Statement sql) throws IOException
f
- the File object to use.sql
- the Statement to use for execution.IOException
- if there is a problem with reading the file.public String getDeployedLocation()
public String getAppRegisteredName()
public String getCreateJdbcFileName(String bundleName)
public void setCreateJdbcFileName(String createJdbcFileName, String bundleName)
public void setDropJdbcFileName(String dropJdbcFileName, String bundleName)
public void setProcessorType(String processorType, String bundleName)
public String getGeneratedLocation(String bundleName)
public void setGeneratedLocation(String generatedLocation, String bundleName)
public boolean hasDeployCliOverrides()
public boolean hasUndeployCliOverrides()
public boolean getCreateTables(boolean param)
public boolean getDropTables(boolean param)
public boolean getCreateTables(String bundleName)
public void setCreateTablesValue(boolean createTablesValue, String bundleName)
public boolean getDropTables(String bundleName)
public void setDropTablesValue(boolean dropTablesValue, String bundleName)
public static String getDDLNamePrefix(Object info)
info
- the instance to use for the name generation.public boolean executeDDLStatement(File fileName, String resourceName)
fileName
- the create or drop jdbc ddl file.resourceName
- the jdbc resource name that would be used
to get a connection to the database.public boolean executeDDLStatement(String fileNamePrefix, String resourceName)
fileNamePrefix
- the common prefix for the DDL file nameresourceName
- the jdbc resource name that would be used
to get a connection to the database.public void logI18NWarnMessage(String errorCode, String regName, String fileName, Throwable ex)
public String getI18NMessage(String errorCode)
errorCode
- public String getI18NMessage(String errorCode, String regName, String fileName, Throwable ex)
public static void warnUser(ActionReport report, String msg)
msg
- Message for user.Copyright © 2021. All rights reserved.