[QODBC-Desktop] How to Use QODBC with NetBeans Posted by Jack - QODBC Support on 19 December 2016 01:09 PM Note: The JDBC-ODBC bridge driver was removed in Java 8, preventing ODBC drivers from being usable in newer versions of Java or other Java-based applications. The rest of the URL depends on the type of driver you are using. Full details of the JDBC URL for the Easysoft JDBC-ODBC Bridge driver can be found in Getting Started. To help you get started, existing drivers are provided with templates for the correct URL format; if in doubt, refer to the documentation for the driver you are using.
I want to manipulate a Microsoft Access database (.accdb or .mdb file) from my Java project. I don't want to use the JDBC-ODBC Bridge and the Access ODBC driver from Microsoft because:
- the JDBC-ODBC Bridge has been removed from Java SE 8 and is not supported (ref: here),
- the JDBC-ODBC Bridge does not work properly with the Access ODBC driver when text includes Unicode characters with code points above U+00FF (ref: here), so such a setup would not be able to handle characters such as Greek, Russian, Chinese, Arabic, etc.,
- the Access ODBC driver from Microsoft only works in Windows, and
- there are separate 32-bit and 64-bit versions of the Access Database Engine (and ODBC driver) which can be a nuisance for deployment.
I have seen other answers mentioning a JDBC driver for Access databases named UCanAccess. How can I set up my Java project to use this approach?
(Answers suggesting better ways of working with Access databases from Java would also be most welcome.)
1 Answer
UCanAccess is a pure Java JDBC driver that allows us to read from and write to Access databases without using ODBC. It uses two other packages, Jackcess and HSQLDB, to perform these tasks. The following is a brief overview of how to get it set up.
Option 1: Using Maven
If your project uses Maven you can simply include UCanAccess via the following coordinates:
groupId: net.sf.ucanaccess
artifactId: ucanaccess
The following is an excerpt from pom.xml
, you may need to update the to get the most recent release:
Option 2: Manually adding the JARs to your project
As mentioned above, UCanAccess requires Jackcess and HSQLDB. Jackcess in turn has its own dependencies. So to use UCanAccess you will need to include the following components:
UCanAccess (ucanaccess-x.x.x.jar)
HSQLDB (hsqldb.jar, version 2.2.5 or newer)
Jackcess (jackcess-2.x.x.jar)
commons-lang (commons-lang-2.6.jar, or newer 2.x version)
commons-logging (commons-logging-1.1.1.jar, or newer 1.x version)
Fortunately, UCanAccess includes all of the required JAR files in its distribution file. When you unzip it you will see something like
All you need to do is add all five (5) JARs to your project.
NOTE: Do not add loader/ucanload.jar
to your build path if you are adding the other five (5) JAR files. The UcanloadDriver
class is only used in special circumstances and requires a different setup. See the related answer here for details.
Eclipse: Right-click the project in Package Explorer and choose Build Path > Configure Build Path..
. Click the 'Add External JARs..' button to add each of the five (5) JARs. When you are finished your Java Build Path should look something like this
NetBeans: Expand the tree view for your project, right-click the 'Libraries' folder and choose 'Add JAR/Folder..', then browse to the JAR file.
After adding all five (5) JAR files the 'Libraries' folder should look something like this:
IntelliJ IDEA: Choose File > Project Structure..
from the main menu. In the 'Libraries' pane click the 'Add' (+
) button and add the five (5) JAR files. Once that is done the project should look something like this:
That's it!
Now 'U Can Access' data in .accdb and .mdb files using code like this
Disclosure
At the time of writing this Q&A I had no involvement in or affiliation with the UCanAccess project; I just used it. I have since become a contributor to the project.
Gord ThompsonGord Thompsonprotected by Community♦Dec 13 '14 at 19:21
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged javams-accessucanaccess or ask your own question.
This topic provides detailed information on configuring JDBC/ODBCdrivers for your database or external system connection. It includesthe following sections:
Drivers are uniquely different in what they do and the typeof functions they support. The JDBC/ODBC Adapter allows you to pickand choose which driver is best suited for your application environment.There can be significant differences and limitations between drivers.The performance and functionality of the JDBC/ODBC Adapter dependson the selected driver(s). Certain drivers may not support all JDBCfeatures. Consult the documentation for your respective drivers formore information.
While any standards compliant JDBC/ODBC database driver maybe used, the drivers covered in this chapter are used more frequently.For runtime, only drivers that support Connection Pool Data Sourceand XA Data Source are supported. Connection Pool Data Source takesadvantage of the Integration Service's connection pooling inorder to improve performance. For the OTD Wizard, the driver ManagerClass will work. However, not all drivers support all metadata discoverymethods, some of which are needed to build the OTD. Additionally,not all drivers support Updatable ResultSets, Stored Procedures, orStored Procedures with ResultSets. Check with your driver vendor forwhat is supported. The ConnectionPoolDataSource should only be usedfor Outbound Adapters. The Inbound Adapter uses native JDBC and mustuse Driver Manager.
It is recommended that you use the Oracle eWay when using thenative Oracle driver. The JDBC eWay does not support some of the functionsavailable in the Oracle eWay such as creating an OTD from a PreparedStatement, using a Stored Procedure with ResultSets, and CLOB support.
It is also recommended that you use the SQL Server eWay. https://eraclihah1984.mystrikingly.com/blog/sortitoutsi-megapack-5-03-rar-download. TheJDBC driver available for download from the Microsoft web site maynot contain the latest version from the vendor.
Not all drivers support Updatable ResultSets. However, it doesallow standard Insert and Update operations when used with the PreparedStatement feature:
Insert into employee (empno) values(?);
Remember to ensure that the input parameter data types matchthe data types specified in the database table targeted by the PreparedStatements as some drivers always return the data type as a string.Optionally, you may perform the data conversion in the Collaboration.
This document provides database configuration information andenvironment properties specifications for specific JDBC/ODBC drivers.You should use the information listed in the included tables to definevalues for required input parameters.
OTD Wizard: Database Connection Information
To connect to AS/400, use the information provided in Table 1–1 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard. To access DB2, it isrecommended to use the DB2 eWay Adapter or the DB2 Connect eWay Adapter.
Table 1–1 AS/400 Database ConnectionInformationParameter | Value |
---|---|
Driver Jar Files | jt400.jar |
Driver Java Class Name | com.ibm.as400.access.AS400JDBCDriver |
URL Connection String | jdbc:as400://server-name:server-port/ Note –NOTE: Default server port is 446. |
User Name | Login name of the account used to access the AS/400 database. |
Password | Password associated with the login account name used to connectto the AS/400 database. |
Environment Properties
Use Table 1–2 toconfigure the environment properties for the specified JDBC/ODBC driver.
La saga des Bedwyn (Tome 1) - Un mariage en blanc and millions of other books are available for Amazon Kindle. Learn more Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Un mariage en blanc mary balogh ebook gratuit.
Table 1–2 AS/400 Database EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.ibm.as400.access.AS400JDBCConnectionPoolDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note –NOTE: Default server port is 446. |
DatabaseName | |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
OTD Wizard: Database Connection Information
To connect to Attunity, use the information provided in Table 1–3 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard.
Table 1–3 Attunity Driver Database ConnectionInformationParameter | Value |
---|---|
Driver Jar Files | nvjdbc2.jar |
Driver Java Class Name | com.attunity.jdbc.NvDriver |
URL Connection String | jdbc:attconnect://server-name;DefTdpName=database-logical-name; OneTdpMode=1 Note –The database-logical-name iscreated in the Attunity server. |
User Name | Leave password field blank. Value configured when the databaseentry is created in the Attunity Server. |
Password | Leave password field blank. Value configured when the databaseentry is created in the Attunity Server. |
Environment Properties
Use Table 1–4 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–4 Attunity Driver Database EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.attunity.jdbc.NvXADataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note –NOTE: Default server port is 2551. |
DatabaseName |
|
User | Leave user field blank. Value configured when the database entryis created in the Attunity Server. |
Password | Leave password field blank. Value configured when the databaseentry is created in the Attunity Server. |
DriverProperties | setDefTdpName#database-logical-name##setWorkspace#Navigator## |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
OTD Wizard: Database Connection Information
To connect to MYSQL, use the information provided in Table 1–5 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard.
Table 1–5 MySQL Connector/J Driver DatabaseConnection InformationParameter | Value |
---|---|
Driver Jar Files | mysql-connector-java-3.0.11-stable-bin.jar |
Driver Java Class Name | com.mysql.jdbc.Driver |
URL Connection String | jdbc:mysql://server-name:server-port/database-name Note –NOTE: Default server port is 3306 |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–6 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–6 MySQL Connector/J Driver EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | ccom.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note –NOTE: Default server port is 3306. |
DatabaseName | database-name |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for MySQL.
OTD Wizard: Database Connection Information
To connect to SQL, use the information provided in Table 1–7 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard. To access SQL, it isrecommended to use the SQL Server eWay Adapter.
Table 1–7 PostgreSQL Driver ConnectionInformationParameter | Value |
---|---|
Driver Jar Files | postgresql-8.0-310.jdbc3.jar |
Driver Java Class Name | org.postgresql.Driver |
URL Connection String | jdbc:postgresql://server-name:server-port/database-name Note –NOTE: Default server port is 5432. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–8 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–8 PostgreSQL Driver EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | org.postgresql.jdbc3.Jdbc3ConnectionPool |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note –NOTE: Default server port is 5432. |
DatabaseName | database-name |
User Listen to Guru Randhawa Made In India MP3 song. Made In India song from the album Made In India is released on Jun 2018. The duration of song is 03:22. Download Free Mp3 Mead In India Video Songs All of video/mp3 that appear on this comemp3.com website were found from internet. The WebMaster does not hold any Legal Rights of Ownership on them. We don't save/host this Mead In India Video Songs video/mp3 in our hosting. Jun 06, 2018 Gulshan Kumar and T-Series present Bhushan Kumar's official music video of the song 'Made In India'. Featuring Guru Randhawa & Elnaaz Norouzi, This latest song is composed, written & sung by Guru. Jan 22, 2019 Autoplay When autoplay is enabled, a suggested video will automatically play next. Up next 5 Most Isolated Communities At The End Of The Earth - Duration: 12:08. Mead in india video song. | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for PostgreSQL.
OTD Wizard: Database Connection Information
To connect to Sybase, use the information provided in Table 1–9 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard. To access Sybase, itis recommended to use the Sybase eWay Adapter.
Table 1–9 Sybase JConnect Driver DatabaseConnection InformationParameter | Value |
---|---|
Driver Jar Files | jconn2.jar |
Driver Java Class Name | com.sybase.jdbc2.jdbc.SybDriver |
URL Connection String | jdbc:sybase:Tds:server-name:server-port Note –NOTE: Default server port is 4100. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–10 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–10 Sybase JConnect Driver EnvironmentPropertiesParameter | Value Talking cat apps download. Jul 25, 2018 Talking Tom Cat 2 – the epic sequel to Talking Tom Cat – is better, cooler, and funnier than ever before! It is a fantastic game ☺☺☺💖💖💖💖💖💖💗' Download and play this amazing free app now! Get ready for some fast-paced fun and play MINI-GAMES like Tap Tap, Climber Tom, and more! Talking Tom Cat is brought to you by Outfit7, the makers of My Talking Tom, Talking Tom Gold Run, My Talking Angela, and loads more games that kids and adults around the world love! So don't wait! Play all of Tom's games! Download Talking Tom Cat now! This app is PRIVO certified. |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note –NOTE: Default server port is 4100. |
DatabaseName | database-name |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for Sybase.
OTD Wizard: Database Connection Information
The settings in Table 1–11 describehow to use the DataDirect Sequelink JDBC/ODBC bridge with the JDBC/ODBCeWay. This information demonstrates how Sequelink can be used to interfacewith the ODBC driver. To connect to an Informix database, it is recommendedto use the Informix eWay Adapter.
Table 1–11 Sequelink DataDirect InformixODBC Driver Database Connection InformationParameter | Value |
---|---|
Driver Jar Files | sljc.jar |
Driver Java Class Name | com.ddtek.jdbc.sequelkink.SequeLinkDriver |
URL Connection String | jdbc:sequelink://server-name:server-port Note –NOTE: Default server port is 19996. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–12 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–12 Sequelink DataDirect InformixODBC Driver Environment PropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.ddtek.jdbcx.sequelkink.SequeLinkDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting Sequelink. |
PortNumber | server-port Note –NOTE: Default server port is 19996. |
DatabaseName | |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for Sequelink DataDirectInformix ODBC.
OTD Wizard: Database Connection Information
To connect to Microsoft Access, via the Microsoft Access ODBCdriver, use the information provided in Table 1–13 to complete the Connect to Database step of the JDBC/ODBCOTD Wizard.
Table 1–13 MS Access ODBC Driver DatabaseConnection InformationParameter | Value |
---|---|
Driver Jar Files | sljc.jar |
Driver Java Class Name | com.ddtek.jdbc.sequelink.SequeLinkDriver |
URL Connection String | jdbc:sequelink://server-name:server-port Note –NOTE: Default server port is 19996. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–14 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–14 MS Access ODBC Driver EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.ddtek.jdbcx.sequelkink.SequeLinkDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting Sequelink. |
PortNumber | server-port Note –NOTE: Default server port is 19996. |
DatabaseName | |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for Sequelink DataDirectMS Access ODBC.
OTD Wizard: Database Connection Information
To connect to Teradata, via the Teradata driver, use the informationprovided in Table 1–15 tocomplete the Connect to Database step of the JDBC/ODBC OTD Wizard.
Table 1–15 Teradata Driver Database ConnectionInformationParameter | Value |
---|---|
Driver Jar Files | teradata.jar |
Driver Java Class Name | com.ncr.teradata.TeraDriver |
URL Connection String | jdbc:teradata://server-name:server-port/database-server-name Note –NOTE: Default server port is 6666 forthe Type-3 driver Gateway. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–16 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–16 Teradata Driver EnvironmentPropertiesJdbc Odbc Driver Download
Parameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.ncr.teradata.TeraConnectionPoolDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note –NOTE: Default server port is 6666 forthe Type-3 driver Gateway. |
DatabaseName | database-name |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | setURL#jdbc:teradata://server-name:server-port/database-server-name ##setDSName#database-server_name## |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 2. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
Refer to the following when troubleshooting Driver issues.
How To Install Sun.jdbc.odbc.jdbcodbcdriver In Netbeans
The ReceiveOne operation in BPEL is not supportedwhen using inbound functions with some drivers.
Some drivers do not support Updatable ResultSets.If you find this to be the case, use a Prepared Statement to Update,Insert, and Delete data.
Not all drivers provide metadata information suchas column names and data types. If your table does not have columnnames and data types, add them before saving the OTD.
The database drivers specified in your projects need to be installedon both the Enterprise Designer machine and the Logical host machine.When installing the drivers on the Enterprise Designer machine, youmust specify the absolute path to the driver. When installing thedrivers on the Logical Host, place the driver into the Logical Host
where JavaCAPS51 is the locationof your Sun Java Composite Application Platform Suite installation.
The driver file must be copied to the latter folder if you arerunning multiple domains and wish to specify a driver for each domain.Otherwise, you only need to copy the driver file to the former folderaddress.
For procedures on how to install database drivers,see Configuring JDBC/ODBC Drivers