Recommendation for Embedded DB with External ODBC Access? - java

Is there a database that can be embedded in a Java program but also allow access through ODBC; more specifically, ODBC through ADOdb?
The environment is MS Windows (XP on).
The situation is that a Java program (mine) runs an external program (not mine) that uses an ADOdb.Connection object to connect to the embedded database and extract data. Oh, legacy support.
I've been trying to set this up using Derby (i.e. JavaDB/Cloudscape) and the NetworkServerControl object, but cannot figure out how to configure the System DSN such that an ADODB.Connection object can connect. Chances are I'm doing it wrong, but I can't figure out how to specify the path to the Derby files.
Is there an embedded db that can be accessed in this manner? Preferably one (unlike Derby) that doesn't require unsupported third-party drivers for ODBC access?
Alternatively, am I going about this completely wrong? I'm not very conversant with databases, nor ADOdb or .NET in general.

H2 stated a ODBC driver on the features list (but still experimental).

Related

Using UCanAccess with DNS

How can I access ODBC 32-bit drivers with UCanAccess with DNS?
jdbc:ucanaccess:pmg
Here is the 32-bit driver from a custom ODBC driver:
I'm using Java 11 with JavaFX.
Short answer: You cannot.
UCanAccess is a JDBC driver to access databases which were created by the Microsoft Jet Engine, the default database format used by MS Access. It does this by leveraging Jackcess, which is able to read directly the database file format bypassing MS DLLs so it is able to work under Linux.
But if you use Access only as a GUI to access another database like SQL Server or Acomba via ODBC UCanAccess is unable to access those database links.
So you need a JDBC driver for your target database. It seems there is none for Acomba. And the old built-in JDBC-ODBC-Bridge driver is no longer provided since Java 8 and was never intended for production use. There was a commercial JDBC-ODBC-Bridge driver provided by Easysoft. But the Easysoft web site is no longer available. So it seems you are out of luck. Maybe you can implement the data access part with another programming language which supports ODBC.

how Derby database works?

Wikipedia states that derby database can be embedded in a java application. Does it mean that we do not need to install a database server separately as if we were using Mysql for the same application?
Does it mean that we can simply ship a jar file with the database embedded in it, and not worry about installing a database server separately?
Yes you are right, Derby is a database internally supported by Java. This database can be of particular use when creating desktop applications or creating applications in which we do not want to install a database server on target machine.
Derby libraries can directly read database files that are held in JAR archives, so no need to install Database servers for this. Derby has all of the features that you would expect from a modern SQL database.

Delivering a Java application with SQL Server 2008 database

I have developed a Java project that uses an SQL Server 2008 Database. Now if I want to deliver this Java application to any person such as client that will practically implement my Java application into his/her use, how will I deliver the database that is used to store the data used by the application? i-e I need to deliver the database with jar file.
If I understand correctly, you're asking how to package an MS SQLServer database in a java jar file?
That's just not possible, sorry. SQLServer is a commercial, platform-specific (Windows), native application, so the will have to be installed by the 'client'.
If you really need to embed the database in your application, and don't absolutely need to use SQL Server, there are several Java-based, embeddable databases available, such as HSQLDB, H2, Derby, SQLite, etc.

How to connect MS Access database to Java Applet

We have to create a Java project on ATM Mechanism. We plan to connect it to a database also.
Could you please help me as to how I can connect an MS Access database to a Java applet which we have created using BlueJ?
Thank you.
Connecting the applet with MSAccess would be very complex, because of applet security limitations. An applet is not supposed to access local resources (files), so you would have to add all kinds of signatures to the applet for the browser to allow this (I did something like this about 12 years ago, and from my knowledge, the applet security limitations are still in place, or even worse).
But if you do manage to access the local filesystem, you can use some library like Jackcess or access the mdb file directly using jdbc/odbc driver as shown here.

Connect derby database with .net

I've been searching for an answer to a question which is as easy to ask, as it difficult to find an answer:
Is there any possible way in .Net that I can use to connect to Apache Derby?
Is there any supported embedded database [with in local drive] as same as Apache Derby in .net?
Is there any supported network database [with in local drive on network] as same as Apache Derby in .net?
As .Net can't connect through JDBC and Derby doesn't support anything else I doubt you will be able to do this.
As you are apparently looking for an embedded Database you might want to have a look at Firebird: http://www.firebirdsql.org/
It does have a .Net connector if I'm not mistaken and you can run it as a network server, or a "file-base" embedded engine.
It is a very nice and capable DBMS (it has several features Derby does not have), the only drawback is that the documentation is a mess (there is no single complete manual that would cover the complete SQL syntax for the current version).

Categories