can Apache Camel output a jdbc interface instead of Java object maps? - jdbc

Can Apache Camel output a jdbc interface instead of Java object maps?
I need to read from CouchdB AND output standard JDBC query results
I thought I could use Camel as the connector.
It can read CouchDB but apparently can not output standard JDBC objects to a client app.
Is there anyway Camel can output JDBC results?
I have a tool that needs a JDBC connection and a standard JDBC interface.

Do you mean you want the data from the database as a javax.sql.ResultSet or what kind of interface do you think about? The camel-couchdb component uses a Couch Java Client and not a JDBC driver, so you cannot do this with Camel.
But you can look at using a JDBC driver for CouchDB and not use Camel at all.

Related

How to use Spring transactions with plain old jdbc connection without Spring jdbc template?

We have an old EJB based web application which we are supposed to migrate into Spring boot. For database connectivity, it is a plain old jdbc connection approach as of now.
We want to use Spring transactions and remove EJB transactions but willing to keep plain old jdbc connectivity same. In short we don't want to make changes in our DAO layer to convert plain old jdbc to Spring JdbcTemplate.
Please note that we have our own connection pooling algorithm and we create connection object and close it in the pool.
Along with this we want our application to be multi-tenant that can work with multiple databases on the basis of 'tenantID' that we will provide.
I actually tried to implement this but it is not working. I had to manually do con.commit(); and con.rollback();
Is there any way to use Spring transactions with plain old jdbc connectivity with above scenario?

Incremental fetch from Oracle

Is there any way to fetch incremental data from an Oracle database using user-defined query using JDBC?
We are ok to use Spark, Kafka or plain JDBC.
The only thing it should be able to support heavy load.
You've not specified the destination. If it's a Kafka topic then using Apache Kafka makes sense to do the extract too, using Kafka Connect.
In which case, you can use the Kafka Connect JDBC connector to do this. See here for the specifics on using incremental mode with a custom query.
++ EDIT ++
If your final target is BigQuery then you can use Kafka Connect for that too with the appropriate BigQuery connector. You can see an example of it in action here.

How to access gemfire cache from jdbc driver

I have a gemfire cache v8.2.1 from which I want to access data using a third party tool which can only access data using jdbc driver only. Does anyone know how can I connect to gemfire cache for accessing data using jdbc? I don't require to write to cache, just want to read from the cache.
I came across with gemfirexd on internet but can see that its marked as "End of availability".
Is there any other way where persisted Objects can be retrieved or OQL can be fired but can mimic a jdbc driver so that the any tool that accepts only jdbc drivers can be used?
Please help.
Thanks
Apache Calcite has a Geode adapter that enables you read data from GemFire over JDBC. There is also this video explaining this.

JDBC connectivity from Airpal

Airpal currently uses presto client to connect to PrestoDB. However as I understand, it can also use JDBC for this connectivity. Is there any code available for this purpose? Even if it is for connecting to any other database it might be helpful for me. The model for presto client looks a lot different than other models like JDBC etc.
Airpal is using presto client connectivity and also using these objects (mostly for schema and data like Column, QueryResults etc.) internally in its various modules.
One way for providing JDBC connectivity is to move its lowest layer of DB connectivity (executeWith invocations of com.airbnb.airpal.core.execution.QueryCliemt: there is 1 for data and about 6 for metadata) to JDBC query execution. The JDBC results (mostly data and schema) can then be converted to presto client api equivalent objects and rest of the logic in airpal would follow.
Another approach is to rewrite airpal with native JDBC support by moving over to JDBC objects for internal use and communication as well. It looks like a much bigger change.
I am planning to add support for dynamically choosing between presto client or JDBC connectivity. I will use the com.airbnb.airpal.presto.QueryRunner to hold either a presto client session or a JDBC connection accordingly.

Force encrypted network traffic with Oracle thin client and jdbc?

Is there a way to force encryption of network traffic (that is, result set data) using Oracle thin client and jdbc?
I understand that this can be done by setting up a java.util.Properties object and passing that to DriverManager.getConnection( String, Properties), but is there a way to specify this in the jdbc url?
I'm using a third party tool written in Java, which handles creating its own connections, so creating and passing the Properties object won't work for me.
Thanks.
Have a look at the Oracle JDBC documentation. There is a chapter about Client Side Security Features, that talks about using system properties to configure a Thin Driver for SSL.

Resources