Add support for new URL syntaxes in Oracle connections
------------------------------------------------------
Key: GEOT-700
URL: http://jira.codehaus.org/browse/GEOT-700
Project: GeoTools
Type: Improvement
Components: oraclespatial
Versions: 2.2.M0
Reporter: Paolo Rizzi
Assigned to: Sean Geoghegan
Recently I started using the oracle spatial DataStore to access an Oracle
10g instance. I'm not an Oracle expert but I found out a few things.
To connect via JDBC you can use three different syntaxes (using the newest
version of
Oracle's driver, that is ojdbc14.jar version 102010):
1) jdbc:oracle:oci:@host:port:instance
2) jdbc:oracle:oci:@//host:port/instance
3)
jdbc:oracle:oci:@(DESCRIPTION=(FAILOVER=ON)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=...(DELAY=20))))
With the last syntax you can specify directly the entire parameters you'd put
inside a tnsnames.ora file if using an OCI connection.
Adding support for the alternative syntaxes seems to be just a matter of
modifying a constructor of:
org.geotools.data.oracle.OracleConnectionFactory
like this:
public OracleConnectionFactory(String host, String port, String instance) {
if( instance.startsWith("(") )
dbUrl = JDBC_PATH + instance;
else if( instance.startsWith("/") )
dbUrl = JDBC_PATH + "//" + host + ":" + port + instance;
else
dbUrl = JDBC_PATH + host + ":" + port + ":" + instance;
}
So if the instance parameter starts with a "(" the syntax 3) will be used.
If it starts with "/" the syntax 2) will be used.
Otherwise the "normal" syntax 1) will be used.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel