hi,
Please help me.
How to create an Access database using Java?
THank you
Quick summary: creating an Access file and talking to it from Java are two different tasks. If you meant “create” a .mdb/.accdb file programmatically, use the Jackcess library; if you meant “connect” from Java to an existing Access file, use a modern JDBC driver such as UCanAccess. Earlier answers and links on this thread (and many old how‑tos) rely on the historic JDBC‑ODBC bridge (sun.jdbc.odbc), which was removed in Java SE 8 and is not present in modern JDKs. JDK 8 compatibility guide. (oracle.com)
A practical, cross‑platform approach: use UCanAccess (pure‑Java JDBC driver) to avoid ODBC and Windows‑only drivers. UCanAccess is a thin JDBC layer that uses Jackcess + HSQLDB under the hood and supports .mdb/.accdb files. Add the UCanAccess dependency or drop its uber JAR on the classpath, then connect like this:
String url = "jdbc:ucanaccess://C:/path/to/mydb.accdb";
try (Connection conn = DriverManager.getConnection(url)) {
// use conn.createStatement() / PreparedStatement as usual
} See the UCanAccess project notes for features and packaging. (spannm.github.io)
If you need to create a new Access file from Java (not just open one), use Jackcess’s DatabaseBuilder API. Example:
File f = new File("C:/tmp/newdb.accdb");
try (Database db = DatabaseBuilder.create(Database.FileFormat.V2010, f)) {
new TableBuilder("People")
.addColumn(new ColumnBuilder("ID").setSQLType(Types.INTEGER))
.addColumn(new ColumnBuilder("Name").setSQLType(Types.VARCHAR))
.toTable(db);
} Jackcess is the canonical library for programmatic creation/modification of Access files. (jackcess.sourceforge.io)
Troubleshooting notes: if you try the native ODBC/OLEDB route on Windows, be careful — Jet/ACE drivers are sensitive to 32‑ vs 64‑bit mismatches (the engine/Office bitness must match the JVM/process). For many deployments that headache alone makes UCanAccess + Jackcess the simpler choice. If you must use the Microsoft drivers, follow Microsoft guidance about ACE/Jet and matching architectures. (learn.microsoft.com)
Recommended workflow: decide whether you need true Access features (queries, forms) or just a file format. For file format + portability use Jackcess to create files and UCanAccess for JDBC access; for legacy Windows‑only integration use the Microsoft drivers but test bitness carefully.
Jump to Post— Paladine 138What do you mean...create a database? Do you have access? Do you have a set of tables already created? Are you meaning to connect to an access database?
Jump to Post— oberoc 0Try this:
That is a how-to to access Access from Java
-Tino
What do you mean...create a database? Do you have access? Do you have a set of tables already created? Are you meaning to connect to an access database?
Try this:
That is a how-to to access Access from Java
-Tino
i have already deisign Access database proble is to connect to it by using java
how to get data in Access database by using java
Read up on JDBC. It's quite simple once you get around to experimenting and learning a bit.
how do I start making database in using access database using java?
please help me....
Thank you...
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.