You can't (AFAIK) set this as part of the URL. As per the OracleDriver documentaion:
Specifying a Database URL and Properties Object
The following signature takes a URL, together with a properties object
that specifies user name and password (perhaps among other things):
getConnection(String URL, Properties info);
Where the URL is of the form:
jdbc:oracle:<drivertype>:@<database>
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:oci8:@",info);
The table that lists the connection properties that Oracle JDBC drivers support includes includeSynonyms
, so you should be able to do:
String url = "jdbc:oracle:thin:@//<HOST>:1522/dev"
java.util.Properties info = new java.util.Properties();
info.put ("includeSynonyms", "true");
getConnection (url, info);
Untested I'm afraid, and I'm not sure if it works with your driver version. You could also look at setting it later via an
OracleConnection or OracleConnectionWrapper.
Also not entirely sure that URL form works with the 1.4 driver, though I think it does - you might need to use your original @<host>:1522:dev
form. And note that in the easy connect format, dev
refers to the service name rather than the SID, and they might not be the same; check what lsnrctl status
shows if this is problematic.