Java : Sqlexection 메시지 받기 "{ '{'”근처에있는 구문이 잘못되었습니다.
-
18-09-2019 - |
문제
플랫폼 : SQL Server 2000 Java 1.4
String queryStringForCustomer = "{call MIGRATE_CUSTOMERS_FILE(?,?)}";
String queryStringForCard = "{call MIGRATE_CARDS_FILE(?,?)}";
for(int i=0;i<recordIds.size();i++)
{
if(FileType.equals("1")){
callableStatement = connection.prepareCall(queryStringForCustomer);
callableStatement.setString(1,(String)recordIds.get(i));
callableStatement.setInt(2, 0);
callableStatement.execute();
}else {
callableStatement = connection.prepareCall(queryStringForCard);
callableStatement.setString(1,(String)recordIds.get(i));
callableStatement.setInt(2, 0);
callableStatement.execute();
}
callableStatement.close();
}
excute ()의 아래 코드에서 호출은 "{ '"에 가까운 메시지와 함께 SQL 예외를 제공합니다.
절차 선언 코드 시작 코드는 다음과 같습니다
CREATE PROCEDURE MIGRATE_CUSTOMERS_FILE
@FILE_RECORD_ID VARCHAR(200),
@IS_FILE NUMERIC(2) = 1
이 버그를 해결하도록 도와주세요? 정보가 문제를 해결하기에 충분하지 않은 경우, PLS는 정보를 제공합니다.
해결책
노력하다 prepareStatement(...)
대신에 prepareCall(...)
.
제휴하지 않습니다 StackOverflow