Oracle Slow Batch Update

I have a rather confusing and strange problem using JDBC on an old Oracle server (it's 8i, as I was told). I prepared a table with about 10 columns, numbers, varchars, raw (255) and some dates in it, without restrictions, without keys, etc. From this side, everything is quickly assumed. Subsequently, my application seemed very slow (pasting 25,000 data in about 30-50 seconds ...). My environment is almost the last 1.6 JDK, ojdbc14 driver from 10.2.0 Oracle. So I cut this piece of code and tested these things separately. Some background information about the code, its essential parts here

Class.forName("oracle.jdbc.driver.OracleDriver"); // I tried with oracle.jdbc.OracleDriver too
Connection conn = DriverManager.getConnection("thin url", "user", "pass");
conn.setAutoCommit(false);
PreparedStatement pstmt = conn.prepareStatement(SQL_STMT); // SQL_STMT is a simple <i>INSERT INTO tablename (column1, column2, column3) VALUES (value1, value2, value3)</i> command with 10 parameters

for(int i = 0; i < numOfData; ++i) {
   pstmt.setObject(objects[i]); // objects has the data for example. I also tried setInt, setDate, etc with the corresponding types, does not speeds it up
   pstmt.addBatch();
}
pstmt.executeBatch();
conn.commit();
conn.setAutoCommit(true);
pstmt.close();
conn.close();

, . H2 DB, , 0 500 000 , (, 0 , , ). ojdbc6 . , ojdbc14 jdk 1.6.idontknow .

ojdbc14 executeBatch FINEST, , , , oracle.jdbc.driver.DBConversion.stringToDriverCharBytes . , " ", . Commiting, pstmt .. , executeBatch.

FYI jdbc , .

, ? , ?

+3
1

" ", Oracle OCI. , , . , , , ​​.

0

All Articles