JDBC Developer's Guide - Supra - Cincom
JDBC Developer's Guide - Supra - Cincom JDBC Developer's Guide - Supra - Cincom
JDBC and multi-threadingThe Cincom ORDB JDBC driver provides support for programs that use multiplethreads.The following files show a simple multithreaded Cincom ORDB JDBC applicationand can be found in the %ORDB%\demo\jdbc\samples directory:♦ threadSample.java♦♦sqlExecuteThread.javasqlResultsThread.javaJDBC Developer's Guide, P25-9504-03 Page 86Chapter: 6. Coding tips and troubleshootingSection: JDBC and multi-threading
Performance optimizationThe following are performance considerations for your Cincom ORDB JDBCapplication:♦ Disable auto-commit mode♦♦♦♦♦The array interfaceAutomatic custom mappingConnection poolingTrapping exceptionsSchema locksDisabling auto-commit modeAuto-commit mode indicates to the database whether to issue a commit afterevery SQL statement, after every Cincom ORDB JDBC Extension that updates adatabase instance or collection, and after every database method invocation.By default, new connection objects are in auto-commit mode. You can controlthe auto-commit mode for a connection with the setAutoCommit() method ofthe java.sql.Connection interface.You can also control the default auto-commit mode for new connections byusing the setAutoCommitDefault() static method of theordbjava.jdbc.ordbDriver class.Commits are expensive operations, and they cause all ResultSets to discardtheir current position.If auto-commit is disabled (recommended), then the JDBC driver groups theconnection’s SQL statements, and other database modifications into atransactions that is terminated by either a commit( ) or rollback( ) statement.JDBC Developer's Guide, P25-9504-03 Page 87Chapter: 6. Coding tips and troubleshootingSection: Performance optimization
- Page 36 and 37: Invoking database methodsYou can us
- Page 38 and 39: Creating custom Java classes for Ci
- Page 40 and 41: Annotated examples of custom mapped
- Page 42 and 43: The above constructor can be used b
- Page 44 and 45: class jaccommodations.javaThe follo
- Page 46 and 47: public void readSQL(SQLInput stream
- Page 48 and 49: Relating Java classes to database c
- Page 50 and 51: Controlling when custom mapping occ
- Page 52 and 53: Using the getAttributes method of t
- Page 54 and 55: 13 activities// 14 sounds_of_the_ca
- Page 56 and 57: }Statement stmt = conn.createStatem
- Page 58 and 59: In the previous example, the applic
- Page 60 and 61: ♦writeSQL() method. You must impl
- Page 62 and 63: Retrieving a collection and its ele
- Page 64 and 65: while (rset.next()) {// activities
- Page 66 and 67: ordbCollection rooms = null;while (
- Page 68 and 69: public static void main (String arg
- Page 70 and 71: insertValue(Object javaObj, int JDB
- Page 72 and 73: Example using the Array as input pa
- Page 74 and 75: create a new collection of seashore
- Page 76 and 77: 5. Cincom ORDB JDBC NotesIntroducti
- Page 78 and 79: ConnectionThe database does not sup
- Page 80 and 81: PreparedStatementCincom ORDB JDBC D
- Page 82 and 83: Cincom ORDB JDBC Driver does not su
- Page 84 and 85: SQLOutputThe Cincom ORDB JDBC Drive
- Page 88 and 89: Example: Disabling AutoCommit. The
- Page 90 and 91: setConnectPoolTimeout(long millisec
- Page 92 and 93: Logging JDBC callsThe Cincom ORDB J
- Page 94 and 95: Accessing JDBC samplesUse one of th
- Page 96 and 97: IndexAaccesing attribute values,exa
- Page 98: RResultSet objectclosing 23processi
Performance optimizationThe following are performance considerations for your <strong>Cincom</strong> ORDB <strong>JDBC</strong>application:♦ Disable auto-commit mode♦♦♦♦♦The array interfaceAutomatic custom mappingConnection poolingTrapping exceptionsSchema locksDisabling auto-commit modeAuto-commit mode indicates to the database whether to issue a commit afterevery SQL statement, after every <strong>Cincom</strong> ORDB <strong>JDBC</strong> Extension that updates adatabase instance or collection, and after every database method invocation.By default, new connection objects are in auto-commit mode. You can controlthe auto-commit mode for a connection with the setAutoCommit() method ofthe java.sql.Connection interface.You can also control the default auto-commit mode for new connections byusing the setAutoCommitDefault() static method of theordbjava.jdbc.ordbDriver class.Commits are expensive operations, and they cause all ResultSets to discardtheir current position.If auto-commit is disabled (recommended), then the <strong>JDBC</strong> driver groups theconnection’s SQL statements, and other database modifications into atransactions that is terminated by either a commit( ) or rollback( ) statement.<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 87Chapter: 6. Coding tips and troubleshootingSection: Performance optimization