修改oracle地址,改成xmcx1服务器。

This commit is contained in:
Kane Wang 2021-06-11 16:58:34 +08:00
parent 7652e7f636
commit ec9adab717
6 changed files with 55 additions and 8 deletions

View File

@ -1,5 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Kane" />
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@ -176,6 +176,17 @@ public class DataImport
//计数
failCount++;
}
catch( OracleConnectionException error )
{
//查询工号失败
importResult = importResult + "" + rowIndex + "行,保单号" + policyNo + ",经办人" + operatorCode + ",查询工号失败。<br>";
//标志位
isSuccess = false;
//计数
failCount++;
}
catch( SQLException error )
{
int errorCode = error.getErrorCode();

View File

@ -0,0 +1,11 @@
package com.cpic.util.PolicyCheck;
/*
*/
public class PolicyCheck
{
public PolicyCheck()
{
}
}

View File

@ -0,0 +1,9 @@
package com.cpic.util.staff;
public class OracleConnectionException extends Exception
{
public OracleConnectionException( String message )
{
super( message );
}
}

View File

@ -5,7 +5,7 @@ package com.cpic.util.staff;
*/
public class StaffCodeNotExistException extends Exception
{
StaffCodeNotExistException( String message )
public StaffCodeNotExistException( String message )
{
super( message );
}

View File

@ -17,14 +17,14 @@ public class StaffInfo
private String departmentCode;
private String departmentName;
public StaffInfo( String staffCode ) throws StaffCodeNotExistException, ClassNotFoundException
{
public StaffInfo( String staffCode ) throws StaffCodeNotExistException, OracleConnectionException, ClassNotFoundException, SQLException {
if ( staffCode.length() < 3 )
{
throw new StaffCodeNotExistException( staffCode + "不存在。");
}
String oracleURL = "jdbc:oracle:thin:@10.187.11.164:1521:xmcx1";
//String oracleURL = "jdbc:oracle:thin:@10.187.11.164:1521:xmcx1";
String oracleURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
String oracleUserName = "idst0";
String oraclePassword = "cpic123456";
@ -65,12 +65,28 @@ public class StaffInfo
departmentName = result.getString( "department_name" );
}
conn.close();
if ( staffName.isEmpty() == true )
{
//没查到数据
throw new StaffCodeNotExistException("工号" + staffCode + "不存在。");
}
}
catch ( SQLException error )
{
//sql错误当做工号错误抛出
throw new StaffCodeNotExistException( error.getMessage() );
throw new OracleConnectionException( error.getMessage() );
}
finally
{
try
{
if ( conn != null ) {
conn.close();
}
}
catch ( SQLException error )
{
//不处理了
}
}
}