修改oracle地址,改成xmcx1服务器。
This commit is contained in:
parent
7652e7f636
commit
ec9adab717
@ -1,5 +1,5 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<state>
|
<state>
|
||||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Kane" />
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
</state>
|
</state>
|
||||||
</component>
|
</component>
|
@ -176,6 +176,17 @@ public class DataImport
|
|||||||
//计数
|
//计数
|
||||||
failCount++;
|
failCount++;
|
||||||
}
|
}
|
||||||
|
catch( OracleConnectionException error )
|
||||||
|
{
|
||||||
|
//查询工号失败
|
||||||
|
importResult = importResult + "第" + rowIndex + "行,保单号" + policyNo + ",经办人" + operatorCode + ",查询工号失败。<br>";
|
||||||
|
|
||||||
|
//标志位
|
||||||
|
isSuccess = false;
|
||||||
|
|
||||||
|
//计数
|
||||||
|
failCount++;
|
||||||
|
}
|
||||||
catch( SQLException error )
|
catch( SQLException error )
|
||||||
{
|
{
|
||||||
int errorCode = error.getErrorCode();
|
int errorCode = error.getErrorCode();
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.cpic.util.PolicyCheck;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
|
public class PolicyCheck
|
||||||
|
{
|
||||||
|
public PolicyCheck()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package com.cpic.util.staff;
|
||||||
|
|
||||||
|
public class OracleConnectionException extends Exception
|
||||||
|
{
|
||||||
|
public OracleConnectionException( String message )
|
||||||
|
{
|
||||||
|
super( message );
|
||||||
|
}
|
||||||
|
}
|
@ -5,7 +5,7 @@ package com.cpic.util.staff;
|
|||||||
*/
|
*/
|
||||||
public class StaffCodeNotExistException extends Exception
|
public class StaffCodeNotExistException extends Exception
|
||||||
{
|
{
|
||||||
StaffCodeNotExistException( String message )
|
public StaffCodeNotExistException( String message )
|
||||||
{
|
{
|
||||||
super( message );
|
super( message );
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,14 @@ public class StaffInfo
|
|||||||
private String departmentCode;
|
private String departmentCode;
|
||||||
private String departmentName;
|
private String departmentName;
|
||||||
|
|
||||||
public StaffInfo( String staffCode ) throws StaffCodeNotExistException, ClassNotFoundException
|
public StaffInfo( String staffCode ) throws StaffCodeNotExistException, OracleConnectionException, ClassNotFoundException, SQLException {
|
||||||
{
|
|
||||||
if ( staffCode.length() < 3 )
|
if ( staffCode.length() < 3 )
|
||||||
{
|
{
|
||||||
throw new StaffCodeNotExistException( staffCode + "不存在。");
|
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 oracleUserName = "idst0";
|
||||||
String oraclePassword = "cpic123456";
|
String oraclePassword = "cpic123456";
|
||||||
|
|
||||||
@ -65,12 +65,28 @@ public class StaffInfo
|
|||||||
departmentName = result.getString( "department_name" );
|
departmentName = result.getString( "department_name" );
|
||||||
}
|
}
|
||||||
|
|
||||||
conn.close();
|
if ( staffName.isEmpty() == true )
|
||||||
|
{
|
||||||
|
//没查到数据
|
||||||
|
throw new StaffCodeNotExistException("工号" + staffCode + "不存在。");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch ( SQLException error )
|
catch ( SQLException error )
|
||||||
{
|
{
|
||||||
//sql错误当做工号错误抛出
|
throw new OracleConnectionException( error.getMessage() );
|
||||||
throw new StaffCodeNotExistException( error.getMessage() );
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if ( conn != null ) {
|
||||||
|
conn.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( SQLException error )
|
||||||
|
{
|
||||||
|
//不处理了
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user