I'm writting custom JDBC driver for my datasource. I'd like to use it with Business Objects product from SAP. My driver works fine in Squirell SQL, but when installed in Business Objects (specifically Universe Designer) I'm unable to fetch table contents. I've enabled TRACE for whole Business Objects instance and the problem's log looks like this:
dictionary_thread::Columns : CS:Unexpected behavior
com.businessobjects.connectionserver.RDBMSDictionary}.Columns: [com.sap.connectivity.cs.core.CSError: Unexpected behavior
As for debugging my JDBC driver, I've been using log4jdbc as well as custom logging of method calls and return values (via aspects) and I don't see any errors, exceptions coming from my driver.
Perhaps someone knows a solution for this, or knows how to debug this further?
It seems obvious that my driver is not fully JDBC specs comformant, so any Test Suite which could analyze errors in my driver would also be of use.
The JDBC API Test Suite 1.3.1 is quite outdated but it may help you diagnose your issue, at least for JDBC 2.0 API: Download is no longer available, remains an old Documentation
According to JSR221 for JDBC4 you may ask for JavaSE TCK (JCK) sources at no charge but you have to follow this process. You will have to accept OpenJDK TCK license.
Related
Is Spring Data JDBC v1.1.5 recommended for Oracle Database and Enterprise Applications? Lot of samples around the net based on Open Source RDBMS (H2 or PostgreSQL). We are using Spring Data JDBC in a Spring Boot Microservice Application, facing following problems.
Force to write custom converters for oracle.sql.TIMESTAMP, oracle.sql.TIMESTAMPTZ and oracle.sql.DATE and oracle.sql.ROWID etc..
Can't type cast oracle.sql.ROWID to java.lang.Number
Identity must not be null after save.
Spring Data JDBC is absolutely recommended for Enterprise Applications.
Not so much for use with Oracle.
Since the necessary resources (database & JDBC driver) weren't available in a form that could be easily used in integration tests on public platforms, Oracle isn't included in regular builds.
Therefore it is likely that one encounters issues when working with Oracle.
Some are already known, for others issues in Jira or even PRs are highly appreciated.
In my previous spring projects, I always use hibernate+postgresql to store the data. I rencently start to use spring-boot, and I am looking for a database system which allow me embed it in my project, without be required the installation of a external DBMS.
I try use SQLite, but in my searches I found some afirmations Hibernate isn't compatible with SQLite.
Anyone knows if this is possible and could point me a solution?
We've successfuly used HSQLDB with Hibernate for ages.
This is actually super cool for sales, you can demonstrate a working application on (potential) customers machine with the embedded HSQLDB database. And still be able to switch to "the real thing" later on.
See also this:
Does Hibernate Fully Support SQLite
and this:
https://code.google.com/p/hibernate-sqlite/
I have spent a few hours trying to track this one down. A lot of people have reported this error, but ultimately a solution was found. But, none of those solutions worked for me.
I'm developing a Java application using Eclipse. Here is a code snippet:
import java.sql.*
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Eclipse spots an error immediately: Unhandled exception type: ClassNotFoundException.
Project properties indicate the build path includes JRE System Library (jre7).
In Eclipse, I can see that JRE7 includes sun.jdbc.odbc.JdbcOdbcDriver.class
Class.forName() declares that it throws ClassNotFoundException. And this is a checked exception. So you must catch it, or declare that your method throws it as well.
Learn about exception handling by reading the Java tutorial. This is basic stuff that every Java developer must know.
Once you master exceptions, please learn about JDBC. The JDBC-ODBC driver is something that should not be used anymore, for years. Every database now has a native JDBC driver.
"Every database now has a native JDBC driver."
I wish this was true - however there are niche database systems that do not. At my work specifically we are stuck with a database system that is part of a larger piece of software that we need to run the business and cannot easily replace. There is no JDBC driver for it and the developers of the database system have clearly stated that creating one is not a goal of theirs.
You may have good reason to not like the JDBC-ODBC driver, but there are cases where it is the only option.
I am looking for a tool that Logs SQL statemetns fired in the application as I use the application.
I found p6spy. But there is an issue with that. It doesnt seem to be compatible with XA Datasources.
Is there a way to make p6spy work on Websphere 6.1 OR is there an alternative to p6spy ?
Also, if anyone has any AspectJ code that intercepts the PreparedStatment object and dumps the SQL, that would also be great.
It is not mandatory for the JDBC drivers to implement a feature to be able to extract / print out the SQL statements. To be honest, I would do this in database. All reasonable database products can log in detail everything that comes in. Also, you can at the same time get further information like execution plans and their impact on the server.
It does depend on the way that you are accessing the database. If you are using Hibernate then you can make that spit out its SQL, if you are accessing the datasource through WAS then you can use the trace service. Set the trace to something like:
=info: com.ibm.websphere.rsadapter.=detail
And see what you get out of it.
I seem to remember there being some parameter you can add to your jdbc url configuration, and/or the connection. Can't remember the details.
You shold change trace level into jdbc driver.
If you using DB2 then change custom properties for data source
if you using Oracle then change driver on the ojbdc6_g.jar and change JVM properties
Does anybody has an experience with Spring Integration project as embedded ESB?
I'm highly interesting in such use cases as:
Reading files from directory on schedule basis
Getting data from JDBC data source
Modularity and possibility to start/stop/redeploy module on the fly (e.g. one module can scan directory on schedule basis, another call query from jdbc data source etc.)
repeat/retry policy
UPDATE:
I found answers on all my questions except "Getting data from JDBC data source". Is it technically possible?
Remember, "ESB" is just a marketing term designed to sell more expensive software, it's not a magic bullet. You need to consider the specific jobs you need your software to do, and pick accordingly. If Spring Integration seems to fit the bill, I wouldn't be too concerned if it doesn't look much like an uber-expensive server installation.
The Spring Integration JDBC adapters are available in 2.0, and we just released GA last week. Here's the relevant section from the reference manual: http://static.springsource.org/spring-integration/docs/latest-ga/reference/htmlsingle/#jdbc
This link describes the FileSucker with Spring Integration. Read up on your Enterprise Integration patterns for more info I think.
I kinda think you need to do a bit more investigation your self, or do a couple of tries on some of your usecases. Then we can discuss whats good and bad
JDBC Adapters appear to be a work in progress.
Even if there is no specific adapter available, remember that Spring Integration is a thin wrapper around POJOs. You'll be able to access JDBC in any component e.g. your service activators.
See here for a solution based on a polling inbound channel adapter too.