- 论坛徽章:
- 0
|
看来想在url中指定是不现实的了
因为在oralce FAQ中提到
- How do I use the Properties argument?
- In addition to the URL, use an object of the standard Java Properties class as input. For example:
- java.util.Properties info = new java.util.Properties();
- info.put ("user", "scott");
- info.put ("password","tiger");
- info.put ("defaultRowPrefetch","15");
- getConnection ("jdbc:oracle:oci:@",info);
- The table below lists the connection properties that Oracle JDBC drivers support. Not all versions support all properties. The table below is the complete list for 10.1.0. If a property is not supported, it is silently ignored.
- Connection Properties Recognized by Oracle 10.1.0 JDBC Drivers Key Value Comment
- user String The value of this property is used as the user name when connecting to the database.
- password String The value of this property is used as the password when connecting to the database.
- database String The value of this property is used as the SID of the database.
- server String The value of this property is used as the host name of the database.
- internal_logon String The value of this property is used as the user name when performing an internal logon. Usually this will be SYS or SYSDBA.
- defaultRowPrefetch int The value of this property is used as the default number of rows to prefetch.
- defaultExecuteBatch int The value of this property is used as the default batch size when using Oracle style batching.
- processEscapes boolean If the value of this property is "false" then the default setting for Statement.setEscapeProccessing is false.
- disableDefineColumnType boolean When this connection property has the value true, the method defineColumnType is has no effect. This is highly recommended when using the Thin driver, especially when the database character set contains four byte characters that expand to two UCS2 surrogate characters, e.g. AL32UTF8. The method defineColumnType provides no performance benefit (or any other benefit) when used with the 10.x.x Thin driver. This property is provided so that you do not have to remove the calls from your code. This is especially valuable if you use the same code with Thin driver and either the OCI or Server Internal driver.
- DMSName String Set the name of the DMS Noun that is the parent of all JDBC DMS metrics.
- DMSType String Set the type of the DMS Noun that is the parent of all JDBC DMS metrics.
- AccumulateBatchResult boolean When using Oracle style batching, JDBC determines when to flush a batch to the database. If this property is true, then the number of modified rows accumulated across all batches flushed from a single statement. The default is to count each batch separately.
- oracle.jdbc.J2EE13Compliant boolean If the value of this property is "true", JDBC uses strict compliance for some edge cases. In general Oracle's JDBC drivers will allow some operations that are not permitted in the strict interpretation of J2EE 1.3. Setting this property to true will cause those cases to throw SQLExceptions. There are some other edge cases where Oracle's JDBC drivers have slightly different behavior than defined in J2EE 1.3. This results from Oracle having defined the behavior prior to the J2EE 1.3 specification and the resultant need for compatibility with existing customer code. Setting this property will result in full J2EE 1.3 compliance at the cost of incompatibility with some customer code. Can be either a system property or a connection property.
- The default value of this property is "false" in classes12.jar and ojdbc14.jar. The default value is "true" in classes12dms.jar and ojdbc14dms.jar. It is true in the dms jars because they are used exclusively in Oracle Application Server and so J2EE compatibility is more important than compatibility with previous Oracle versions.
-
- oracle.jdbc.TcpNoDelay boolean If the value of this property is "true", the TCP_NODELAY property is set on the socket when using the Thin driver. See java.net.SocketOptions.TCP_NODELAY. Can be either a system property or a connection property.
- defaultNChar boolean If the value of this property is "true", the default mode for all character data columns will be NCHAR.
- useFetchSizeWithLongColumn boolean If the value of this property is "true", then JDBC will prefetch rows even though there is a LONG or LONG RAW column in the result. By default JDBC fetches only one row at a time if there are LONG or LONG RAW columns in the result. Setting this property to true can improve performance but can also cause SQLExceptions if the results are too big.
- remarksReporting boolean If the value of this property is "true", OracleDatabaseMetaData will include remarks in the metadata. This can result in a substantial reduction in performance.
- includeSynonyms boolean If the value of this property is "true", JDBC will include synonyms when getting information about a column.
- restrictGetTables boolean If the value of this property is "true", JDBC will return a more refined value for DatabaseMetaData.getTables. By default JDBC will return things that are not accessible tables. These can be non-table objects or accessible synonymns for inaccessible tables. If this property is true JDBC will return only accessible tables. This has a substantial performance penalty.
- fixedString boolean If the value of this property is "true", JDBC will use FIXED CHAR semantic when setObject is called with a String argument. By default JDBC uses VARCHAR semantics. The difference is in blank padding. With the default there is no blank padding so, for example, 'a' does not equal 'a ' in a CHAR(4). If true these two will be equal.
- oracle.jdbc.ocinativelibrary String Set the name of the native library for the oci driver. If not set, the default name, libocijdbcX (X is a version number), is used.
- SetBigStringTryClob boolean Setting this property to "true" forces PreparedStatement.setString method to use setStringForClob if the data is larger than 32765 bytes. Please note that using this method with VARCHAR and LONG columns may cause large data to be truncated silently, or cause other errors differing from the normal behavior of setString.
- oracle.jdbc.StreamBufferSize int Set size of the buffer for the InputStream/Reader obtained from getXXXStream/getXXXReader. The default size is 16k. The size passed should be at least 4096 or else 4096 is assumed.
- OCINewPassword String Pass the value of new password to be set during logon. This could be typically used for resetting the password when the password has expired or when the account is in the grace period.
- oracle.jdbc.RetainV9BehaviorForLongBind boolean This is applicable only for the thin driver.
- Pass true to retain the V9 bind behavior for Long and potential long binds.
- false is the default behavior which would emulate the same behavior as in OCI driver.
- oracle.jdbc.FreeMemoryOnEnterImplicitCache boolean Clear the define buffers before caching the statement when Implicit statement caching is enabled.
- Setting the value to true would enable the clearing of define buffers before caching of Statements in the Statement cache. false is the default value and this would behave in the same way as statement caching worked in prior releases.
-
- oracle.jdbc.ReadTimeout int Read timeout while reading from the socket. This affects thin driver only. Timeout is in milliseconds.
-
- Back to Top
- 根本就没有设置字符集的属性,而且属性不能直接在url中增加
复制代码 |
|