删除finally的方法
This commit is contained in:
parent
5ba8639379
commit
2e8337722b
|
@ -126,20 +126,48 @@ public class OracleExtractHelper {
|
|||
public boolean createTableSpace(Connection conn,
|
||||
OracleConnectorParams collectOracle, GatherOracleInfo oc) {
|
||||
String tmpSql = "select TABLESPACE_NAME from dba_tablespaces where TABLESPACE_NAME = '"
|
||||
+ oc.getTableName() + "'";
|
||||
+ oc.getTableName().toUpperCase() + "'";
|
||||
// 存在 表空间
|
||||
if (OracleConnector.execUpdateOracleSQL(conn, tmpSql,
|
||||
Configs.EXTRACT_LOG_LOCALTION + collectOracle.getName())) {
|
||||
return true;
|
||||
} else {
|
||||
String sql = "create tablespace " + oc.getTableName()
|
||||
String sql = "create tablespace " + oc.getTableName().toUpperCase()
|
||||
+ " datafile '" + Configs.GATHER_TABLESPACE_PATH
|
||||
+ oc.getTableName() + ".dbf"
|
||||
+ oc.getTableName().toUpperCase() + ".dbf"
|
||||
+ "' size 512M autoextend on next 512M maxsize unlimited";
|
||||
return OracleConnector.execOracleSQL(conn, sql,
|
||||
Configs.EXTRACT_LOG_LOCALTION + collectOracle.getName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建表空间
|
||||
*
|
||||
* @param conn
|
||||
* 汇总库连接
|
||||
* @param collectOracle
|
||||
* @param oc
|
||||
* 汇总库信息
|
||||
* @return
|
||||
*/
|
||||
public boolean createStardardTableSpace(Connection conn,
|
||||
OracleConnectorParams collectOracle, GatherOracleInfo oc) {
|
||||
// String tmpSql = "select TABLESPACE_NAME from dba_tablespaces where TABLESPACE_NAME = '"
|
||||
// + oc.getTableName().toUpperCase() + "'";
|
||||
// // 存在 表空间
|
||||
// if (OracleConnector.execUpdateOracleSQL(conn, tmpSql,
|
||||
// Configs.EXTRACT_STANDARD_LOG_LOCALTION + collectOracle.getName())) {
|
||||
// return true;
|
||||
// } else {
|
||||
String sql = "create tablespace " + oc.getTableName().toUpperCase()
|
||||
+ " datafile '" + Configs.GATHER_TABLESPACE_PATH
|
||||
+ oc.getTableName().toUpperCase() + ".dbf"
|
||||
+ "' size 512M autoextend on next 512M maxsize unlimited";
|
||||
return OracleConnector.execOracleSQL(conn, sql,
|
||||
Configs.EXTRACT_STANDARD_LOG_LOCALTION + collectOracle.getName());
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建用户并授权
|
||||
|
@ -178,10 +206,10 @@ public class OracleExtractHelper {
|
|||
GatherOracleInfo totalOracle) {
|
||||
String strTUser = Configs.GATHER_STANDARD_USER_NAME;
|
||||
|
||||
String sql = "Create user " + strTUser + " default tablespace "
|
||||
String sql = "Create user " + strTUser.toUpperCase() + " default tablespace "
|
||||
+ totalOracle.getTableName() + " identified by "
|
||||
+ Configs.GATHER_TABLE_PASSWORD;
|
||||
String grantSql = "grant connect, resource, dba to " + strTUser;
|
||||
String grantSql = "grant connect, resource, dba to " + strTUser.toUpperCase();
|
||||
|
||||
OracleConnector.execOracleSQL(conn, sql,
|
||||
Configs.EXTRACT_STANDARD_LOG_LOCALTION + oc.getName());
|
||||
|
@ -331,7 +359,7 @@ public class OracleExtractHelper {
|
|||
}
|
||||
|
||||
private void createPay(Connection conn, OracleConnectorParams oc) {
|
||||
String payCmd = "CREATE TABLE u_bzbjy.zfxxb(XZQHDM Varchar(255),XZQHMC Varchar(255),PZBH Varchar(255),LYZBKZH Varchar(255),"
|
||||
String payCmd = "CREATE TABLE U_BZBJY.ZFXXB(XZQHDM Varchar(255),XZQHMC Varchar(255),PZBH Varchar(255),LYZBKZH Varchar(255),"
|
||||
+ "ZFDATE Varchar(255),YSDWCODE Varchar(255),YSDWNAME Varchar(255),YWGKCS Varchar(255),XMCODE Varchar(255),XMNAME Varchar(255),"
|
||||
+ "XMLBCODE Varchar(255),XMLBNAME Varchar(255),ZB_NO Varchar(255),GNFLCODE Varchar(255),GNFLNAME Varchar(255),JJFLCODE Varchar(255),"
|
||||
+ "JJFLNAME Varchar(255),ZJXZCODE Varchar(255),ZJXZNAME Varchar(255),JSBFFSNAME Varchar(255),SKR Varchar(255),SKRYH Varchar(255),"
|
||||
|
@ -412,7 +440,7 @@ public class OracleExtractHelper {
|
|||
}
|
||||
|
||||
private void createExec(Connection conn, OracleConnectorParams oc) {
|
||||
String execCmd = "CREATE TABLE u_bzbjy.kzxzb(XZQHDM Varchar(255),XZQHMC Varchar(255),YSND Varchar(255),ZBCODE Varchar(255),ZB_ID Varchar(255),ZB_NO Varchar(255),"
|
||||
String execCmd = "CREATE TABLE U_BZBJY.KZXZB(XZQHDM Varchar(255),XZQHMC Varchar(255),YSND Varchar(255),ZBCODE Varchar(255),ZB_ID Varchar(255),ZB_NO Varchar(255),"
|
||||
+ "ZBDJLXCODE Varchar(255),ZBDJLXNAME Varchar(255),ZBLXNAME Varchar(255),DOCNO Varchar(255),ZBSM Varchar(255),ZBFWDATE Varchar(255),ZBYSLXCODE Varchar(255),"
|
||||
+ "ZBYSLXNAME Varchar(255),ZBYSLYNAME Varchar(255),YSDWCODE Varchar(255),YSDWNAME Varchar(255),GNFLCODE Varchar(255),GNFLNAME Varchar(255),JJFLCODE Varchar(255),"
|
||||
+ "JJFLNAME Varchar(255),ZBGLCSNAME Varchar(255),SZGLCODE Varchar(255),SZGLNAME Varchar(255),XMCODE Varchar(255),XMNAME Varchar(255),GZBZ Varchar(255),"
|
||||
|
|
Loading…
Reference in New Issue