Connection To Oracle Using Connection Manager
Since JDeveloper is based on JBuilder I thought this might be
a good place to post this question.
I would like to use JBuilder's DataExpress components to
connect to an Oracle database using Oracle's connection
manager. The form for a standardconnection using jBuilder is something like:
db1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:oracle:thin:@host:1521:ORACLE_SID", "user", "password", false, "oracle.jdbc.driver.OracleDriver"));
This connection string works fine.
The format for a connection string using the standard SQL
classes and connecting to the database using connection
manager is something like:
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String connString =
"jdbc:oracle:thin:@(description=(address_list=" +
"(address=(protocol=tcp)(port=1630)(host=bill))" +
"(address=(protocol=tcp)(port=1521)(host=bill)))" +
"(connect_data=(sid=oralin))" +
"(source_route=yes))";
conn = DriverManager.getConnection(connString, "scott", "tiger");
stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery ("Select * from scott.dept");
rs.next();
String xStr = rs.getString(1);
This connection works fine....
You have to specify the connection manager routing in the string.
Questions:
--------------
Does anyone have an example of what a ConnectionDescriptor looks like using JBuilder's data Express components if I want to connect to the database using Oracle's connection manager?
Does JDeveloper include Borland's dataexpress components? How can this be done in JDeveloper? Maybe I will switch the Jdev.
Can it even be done? Is there another approach to use JBuilder's DataExpress class?
Using JBuilder4 and Oracle 8.1.7 (on Linux)