クエリ:
select count(*) from table_name
DB: SQL サーバー
totalrowcount = Integer.parseInt(resultSet.getString(1));
カウントを返すクエリを実行しようとすると、から値を取得しようとすると例外がスローされresultSet
ます。
例外:
com.microsoft.sqlserver.jdbc.SQLServerException: Could not find stored procedure 'count'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
at com.heb.endeca.util.BatchManagerHelper.getRowCount(BatchManagerHelper.java:91)
at com.heb.endeca.util.BatchManagerHelper.generateFeed(BatchManagerHelper.java:70)
at com.heb.endeca.batch.BatchManager.startEndecaBatchManager(BatchManager.java:87)
at com.heb.endeca.batch.BatchManager.main(BatchManager.java:50)