I've been searching for the solution to open a .accdb database and read/write date from and into this file. The file is saved locally and not on a server and the solution should work without additional libraries.
Can someone help me?
Thank you for your advice
My recommendation would be to use UCanAccess.
The other common approach on Windows is was to use the JDBC-ODBC Bridge in conjunction with the Microsoft Access ODBC driver, but
that method has some limitations, particularly with respect to full Unicode support, and
the JDBC-ODBC Bridge has been removed from Java SE 8 and is not supported (ref: here).
For more information on UCanAccess see
Manipulating an Access database from Java without ODBC
There is an Apache Licensed Java library called Jackcess that allows reading/writing MS Access files.
Related
I have a program in c# and need to connect to SQL via JDBC. I read that JDBC works with java and since I need to use it from C#, I found out that there is jni4net that bridges between the two.
I can't seem to find any samples or tutorials on how to do so. Any help will be appreciated. I have read and tried using jni4net, but I couldn't find any sample connecting to a database.
JDBC stands for Java DataBase Connectivity, which means it is for Java (or other languages that can run on the Java Virtual Machine). C# is a different language with its own runtime. Although it may be possible to access Java from C#, doing so for database connections would probably be really cumbersome and slow.
Instead you should look for an ADO.net database provider for your database system(s). Most database systems have one.
You may use the robbiblubber.org JDBC Extension Libaray to connect to a database via JDBC from .NET. Of cource, if there is a native driver for ADO.NET, you should use that.
I am trying to connect to a local .mdb file using Java 8. So far I have used UCanAccess's libraries but not all features are supported.
In Java 8 "JDBC/ODBC was scrapped"... So my question is:
What is the new method to connect to .mdb files (without UCanAccess)?
If you really don't want to use UCanAccess then you'll probably have to buy a third-party library
to replace the JDBC-ODBC Bridge that was removed from Java 8, or
to provide direct JDBC connectivity to the Access database.
However, as Marco indicates in his comment to the question, there could very well be UCanAccess (or HSQLDB) workarounds for your "feature not supported" issues if you care to give us a hint as to what they are.
I'm beginner in semantic web, actually try to build web, I built my ontology, now I try to upload it into MySQL.
Which Java I must use (Java EE SDK or Java JDK) and which Jena (only Jena or Jena TDB OR Jena SDB)?
Normally, use Apache Jena TDB. It's faster and scales better. Use SDB when you must use an SQL database.
MySQL will use its Connector-J JDBC driver. I don't know what the upload software looks like, but that's how it can connect to MySQL. It'll assume that the schema's been created before you try to INSERT any data.
Perhaps this link can help you make your decision:
http://answers.semanticweb.com/questions/506/pros-and-cons-for-different-jena-backends-sdb-vs-tdb
It appears to be an SO-like Q&A site for semantic web. That might be useful for your future work. It could be a better source for answers that SO.
I am considering using a Microsoft access database for a Java project. My question is, if I use a Microsoft access database and I complete my project and run it as a jar file on any computer/operating system, does any computer/ operating system need to have Microsoft access installed on it, particularly if the database needs to be put on a GUI on the java program and the administrator of the program can add and remove entries.
You will have to install the access odbc driver on any machine that accesses the database. I think you can do this by installing the Access runtime stuff without installing all of Access. Keep in mind that this sort of data-access is file-level, so your performance will be very poor. I'd suggest that you use a real database (postgres, mysql, sql server, oracle) or maybe a lightweight one such as SQL Server express and then accessing that database using either an odbc-jdbc bridge or preferably a native jdbc driver. Using a native jdbc driver will let you run your app from a non-windows environment.
You can use a Access Database via the JDBC-ODBC bridge on every Microsoft Windows system without to install Microsoft Access. You only need the Access Database Engine (ACE) formerly known as Jet Database Engine. ACE is part of current Windows versions. For older ones it may be necessary to install the Microsoft Data Access Components (MDAC).
Using a Access Database from Java has some disadvantages:
This is a type 1 driver with native code. Generally pure Java JDBC drivers are more performant.
With JDK 6 the JDBC-OLE bridge was somewhat enhanced. But there are still some problems with charsets and CLOBs.
Your application is restricted to Microsoft Windows operating systems.
According to the JDK 7 JDBC-ODBC bridge guide the JDBC-ODBC bridge will be removed in JDK 8:
The JDBC-ODBC Bridge should be considered a transitional solution; it will be removed in JDK 8. In addition, Oracle does not support the JDBC-ODBC Bridge. Oracle recommends that you use JDBC drivers provided by the vendor of your database instead of the JDBC-ODBC Bridge.
So if there is any chance to use another database for your project, you should avoid using Microsoft Access together with Java.
There are lots of alternatives with far more better JDBC drivers.
If you want a small footprint embedded database, there are:
Java DB (part of the JDK), also known as Apache Derby
H2
HSQLDB
SQLite e.g. with Xerial driver
(Java DB, H2 and HSQLDB are pure Java solutions)
If you prefer a client server solution, for most commercial and open source there exist full-fledged JDBC drivers.
Oracle
Microsoft SQL Server (the server has to run on Windows but your Java client can run on every OS that supports a JVM. See Microsoft JDBC Driver for SQL Server Support Matrix)
PostgreSQL
MySQL
I am attempting to build some java apps that use a FoxPro database that is part of a large Visual FoxPro product. I have been able to read the data using a jdbc-odbc bridge. While I had to search long and hard to find out how to accomplish that task, what I haven't been able to find out is if I can safely insert/delete/edit the tables. I don't know if the index files are used by the jdbc-odbc libraries.
On a related note, does anyone know if you use MS SqlServer to set up a link to the foxpro data will make the FoxPro data "act" like a real relational db, or if the functionality doing things that way is the same as using the odbc solution.
I'm not replacing the current Visual FoxPro product, just trying to add some functionality, and I don't want to break the existing product.
Thanks.
I would imagine the JDBC-ODBC bridge handles indexes transparently, it wouldn't be much use otherwise.
You might be better looking at StelsDBF or Hxtt's native JDBC drivers.
Visual FoxPro is already a relational database. Not sure what you would achieve via the MSSQL approach.