01: package org.dbbrowser;
02:
03: import java.sql.Connection;
04: import java.sql.DriverManager;
05: import java.sql.ResultSet;
06: import java.sql.Statement;
07:
08: public class RecreateOracleCursorError {
09: public static void main(String[] args) {
10: try {
11: System.out.println("Starting test...");
12:
13: //Load the driver class. It gets automatically registered with the DriverManager
14: Class.forName("oracle.jdbc.OracleDriver");
15:
16: //Connect
17: Connection connection = DriverManager.getConnection(
18: "jdbc:oracle:thin:@ophelia:1521:XISTEST", "xcssys",
19: "portal");
20:
21: int counter = 5000;
22: for (int i = 0; i < counter; i++) {
23: Statement statement = connection.createStatement();
24: ResultSet rs = statement
25: .executeQuery("select count(*) from claim");
26:
27: System.out.println(i);
28: statement.close();
29: }
30:
31: connection.close();
32: } catch (Exception exc) {
33: System.out.println("*** ERROR ***\n");
34: System.out.println(exc.getMessage());
35: }
36: System.out.println("end of test");
37: }
38:
39: }
|