Do you know whether PostgreSQL JDBC driver with on-the-fly data encryption exists?
I use PostgreSQL database on Heroku and have requirement to encrypt some sensitive client data on database level. How it's possible to implement this?
Heroku allows to use PostgreSQL pgcrypto module but it allows only per-column encryption and work with the module looks cumbersome. So I'm thinking about data encryption on Java side.
JDBC driver irrelevant to encrypted storage
For encrypting data “at rest”, that is, when written to storage, the JDBC driver is irrelevant.
A JDBC driver’s job is to mediate between a Java app with Java types and a database with database types. The driver communicates with the database, relying your queries, and then marshaling back the results. The driver converts data between the types used on either side.
The JDBC driver does not affect how the data is stored by the database.
Related
Neo4j have recently added a BI connector tool (neo4j.com/bi-connector) which can return relational data from your graph database to your business intelligence tool such as Tableau. The question is can i send SQL queries to this connector assuming i have added the jar file to my java application class path? If yes, which APIs should i use to send this SQL query to the driver?
I'm using Neo4j4.0.
For neo4j.com/bi-connector, if you look at the document PDF that you get when you download it, on page 10 where they show how to establish a connection you'll see that you get a connection object. After you have that, you have a standard JDBC connection which is a Java interface that tells libraries how to talk to a SQL database. There are a lot of different tools that use this interface, it's kind of user preference. A common one is JOOQ.
I'm newbie in JDBC and I was studying about JDBC Driver and I saw this definition of JDBC Driver:
JDBC Driver converts Standard API calls to low level calls.
What are low level calls and standard api calls?
"Standard API" calls are those defined by the JDBC API, basically all the types defined in the java.sql package.
"Low level" calls are whatever calls the JDBC driver need to make in order to actually "communicate" with the database, e.g.
An Oracle OCI driver needs to call the OCI library directly.
An Oracle Thin driver needs to communicate over TCP/IP with the database server.
SQL Server, PostgreSQL, MySQL, etc works like this too.
Embedded database drivers like H2, HSQLDB, Derby, etc. needs to call the Java code implementing the database.
A JDBC driver is used to enable interaction between Java and a database. Each database will have his own driver to interact with the corresponding protocol.
Each JDBC driver are basically translating standard JDBC API calls into native database calls.
(It's a little more complex in reality, if you want all details take at look at the wikipedia page)
I have a typical requirement from my client. There will be several types of databases that I need to connect to and collect some data from them and invoke a webservice with collected data. He will provide all datasource configurations to connect to respected database. based on datasource I need to figure out which database it is and need to prepare a connection management to connect to respected database.
Before hand, I would like to know, Is there any off the shelf API that could suite my requirement. I googled but no luck and hence landed here to post query. Suggestions are invited.
With Java Database Connectivity (JDBC) you can connect to any of the above databases, and there are open source drivers for those and many more.
Here's an example of using JDBC with MySQL. You use the same method to connect to any datasource with a given JDBC driver.
I want to create a Desktop App(Software), preferably in Java, which connects to a central MySQL DB on a local network whenever available.
I also want it to store and use a copy of the same DB when the central DB is not available, and sync whenever the central DB is available.
How can I store data locally, I mean which kind of database should I use for local database?
Also, are there any tools which speed up the Desktop App development?
Let's suppose that you will implement your solution in Java. You will need some classes (i.e. Data Access Obejcts, DAOs) in charge of interacting with the database on the network and on a file based database embedded in the application (the "local" database).
What you need:
A local database that you can ship with your application like H2 www.h2database.com, HSQLDB http://hsqldb.org/ or Derby db.apache.org/derby/.
To develop your DAOs (using JDBC or Hibernate) in such a way that you can instantiate them with different drivers, URLs, login/pwd and use only SQL standard / functions supported both by MySql and by the local DBMS. In practice you must avoid using DB specific functions.
You can use Hibernate or JPA for example, they have quite a nice and easy integration with your application.
I am attempting to simulate a JDBC 3 compliant data source.
I have a legacy java application that only accepts JDBC data sources and cannot be changed. I would like it to be able to use data from a provided JSON file and convert it into some type of source that can be connected to using JDBC. It is impossible to change or access the legacy java application source code, and the application requires data to be retrieved through a JDBC connection.
Is this possible?
At the moment the only solution I can think of is to import the JSON file into a SQL database and then connect to that. I would like to avoid this because the JSON file is originally generated from a database and provided through a web service. I cannot connect to the original database.