Oracle WebLogic allows initializing database connections with SQL Code (s. http://docs.oracle.com/cd/E13222_01/wls/docs81/ConsoleHelp/jdbc_connection_pools.html#1127542). Is there any way to do this in WebSphere 8?
Please see the Connection validation by SQL query column of the Application programming model row in the deprecation table for the recommended alternative. IBM support cannot provide you with a time frame for removal, as there is no fixed time frame for deprecated features to be removed. At a minimum, the feature will not be removed for 2 releases after deprecation. In this particular case, the feature was deprecated because the JDBC spec now defines similar capability.
Yes it is possible. See WebSphere Application Server data source properties page.
You need to check: Validate new connections and provide your SQL code in the: Validation by SQL string in the Data source properties.
Related
I have following environment:
EAR application on WebSphere 9, container managed transactions using XA datasource for Oracle 19c database (let's name it database "A").
The problem is that datasource (in some transactions), i.e. database "A" is calling database "B" via database link (database "B" is also Oracle 19c).
Connection pool gets "Too many database links in use" error message because of 2 phase commit. Let's say max. number of database links in use is 4, if i refresh screen 5th time i get SQL exception.
Setting maximum database links in use parameter in database properties only delays the problem.
I am in no control (from application perspective) of closing database links.
ATM we've set datasource to non-XA and everything works fine, but in some time we'll need to manualy handle transaction that include one datasource and WebSphere MQ.
Anyone got any ideas or experience with this setup?
EDIT: I'm trying to get this working with JPA 2.0.
You have two options:
If not you, then the developers of the application need to make sure the database links get closed. If your max number of active database links is 4, then you can only have 4 active sessions/users in your application.
Increase the allowed number of database links
This article describes the fixes/workarounds in greater detail.
Anyone know why the Netbeans IDE's Database result explorer disables CrUD operations and "Show SQL 'CrUD' Operation" when using a JDBC connection via JTOpen 9.1 driver to a DB2 for i database with Netbeans 8.1?
JTOpen is a open source JDBC driver to IBM i DB2 for i database in addition to bunch of Java Classes for interacting with the IBMi system. http://jt400.sourceforge.net/
I tried a few JDBC connection properties but no cigar...
I guess i'll have to keep browsing the IBM KB
http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/rzahh/jdbcproperties.htm
and the JT400 source
https://github.com/devjunix/libjt400-java/blob/master/src/com/ibm/as400/access/JDProperties.java
Many DB2 for i systems are configured to not use commitment control or journaling. This is not what many toolkits expect to see. Try changing the connection string to tell Netbeans that you don't want commitment control.
Add "extended metadata=true" in the connection properties fixed my issue.
https://godzillai5.wordpress.com/2016/08/21/jdbc-jt400-setting-to-get-crud-and-show-sql-features-added-in-netbeans-with-ibm-db2-for-i/
The IBM documentation here http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/rzahh/jdbcproperties.htm
"extended metadata"
Specifies whether the driver requests extended metadata from the
server. Setting this property to true increases the accuracy of the
information returned from the following ResultSetMetaData methods:
getColumnLabel(int) isReadOnly(int) isSearchable(int) isWriteable(int)
apparently readonly for the result set is incorrectly assumed true, unless the ext. metadata comes back with the actual value for isReadOnly(int). I'm guessing that its assumed false because on the initial connection the connection property "Read Only" is true. It would be helpful to understand what setting on the system or the Library/Schema is causing the connection to have that property.
The most obvious reason for the original image showing just some read-only operations presented, would seem to have been the "access" attribute for the connection; i.e. if set to "read only", that would limit access to SELECT statements only. But with the new information showing the connection properties, seems the readOnly=false, so that "access" attribute should not be the origin for the issue.
I suspect that for any given TABLE, the issue might be for lack of a PRIMARY KEY CONSTRAINT; i.e. IIRC, some client database applications might prevent update-capable mode for a particular TABLE, if that TABLE is not known to have a PK.
We have an external server service running Oracle and we can not access his configuration. We have the code for the application and we are interested in the current implementation of connection.close().
So the question is, running a Oracle 12c database, is it possible to connect to the database using older database driver version such as Oracle 11g? We want to exclude a simple configuration problem by drivers not matching the database product version.
Is there any document (other than JavaDoc) that specificates the implementation behaviour of Connection.close() since the Java spec says its implementation depending and there is no general rule.
If you have Metalink access, you can check MOS note 207303.1 on Client-server interoperability.
In summary, Clients 11.2.0 and above are fully supported; 11.1.0 is supported, but bugfixes are possible only for customers with Extended support.
if the glassfish server loses connectivity with the DB the connections all die. I want to detect it and recover the connection.
When I set it to use "table", this works but when i set it to "meta-data", this seems not working. Anybody know why or is this a known glassfish bug?
Likely not bug in GlassFish, but JDBC driver that caches meta data. This is also addressed in GlassFish documentation:
table: Performing the query on a specified table. If this option is
selected, Table Name must also be set. Choosing this option may be
necessary if the JDBC driver caches calls to setAutoCommit() and
getMetaData().
I am trying to submit XQuery queries to an Oracle 11g database through their XQJ API.
When I instantiate an oracle.xquery.xqj.OXQDataSource as explained in http://www.oracle.com/technetwork/articles/oem/xquery-jdbc-325944.html, I can submit queries fine except that I haven't found how I can set up the server connection (server name, port, username, password, ...) info:
This datasource claims that it doesn't support setting any property.
It doesn't implement the data source constructor which takes a JDBC connection.
I don't see any non standard method to set such info.
When I try to access some random collection like collection("oradb:/foo") I just get an empty result set even when no server is running, suggesting that the driver doesn't even try to connect.
What have I missed and how can I set the server connection info?
Thanks,
Eric
Thanks to Charles Foster I can answer to my own question: the XQJ implementation from Oracle is an old standalone version from January 2010 that is pretty useless and doesn't interact with Oracle databases.
Despite all the Oracle statements about XQJ, I haven't been able to find any client/server XQJ implementation (except one from DataDirect of course) and the way to submit XQuery queries to Oracle databases appears to be through JDBC, embedded in PL-SQL statements.
It is possible in 12.
XQJ to run queries in Java:
http://docs.oracle.com/database/121/ADXDK/adx_j_xqj.htm#ADXDK99930
XQJ to run queries against the database:
http://docs.oracle.com/database/121/ADXDK/adx_j_xqjxdb.htm#ADXDK136