Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What is the recommended way to get a java.sql.Connection to the DB for ADF

JeroenDirksNov 30 2012 — edited Dec 3 2012
How do I create a standalone database connection based on the datasource setup in ADF?

I have seen code like this in a method of AppModuleImpl.java but that seems a bit of a hack.

Connection conn = this.getDBTransaction().createStatement(0).getConnection();

What I need is a java.sql.Connection to the database used in the application module so I can call PL/SQL code and or work with AQ queues.

I would prefer a separate connection from the one used by the ADF model so it can have its own transaction control etc.

But I would like to get the connection created authenticated based on regular datasource setup.

Comments

user9540031
Answer

A quick look into the Globalization Support Guide, sections 5.9.1 Character Range '[x-y]' in Regular Expressions, and 5.5.2 Specifying a Case-Insensitive or Accent-Insensitive Collation, suggests that this is expected behaviour: a < A < b < B (etc.) is true in the GERMAN collating sequence (if I understand well). The reason why there is no match with 'aaaa' is because 'a' is not in the [A-Z] range, whereas 'b' is, when NLS_SORT = 'GERMAN'.
So in this case it would seem that 19.5 gives the right result, whereas 12.1 did not.

Marked as Answer by User_RVFU1 · Dec 18 2020
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 31 2012
Added on Nov 30 2012
2 comments
463 views