What is JDBC Adapter :
The JDBC (Java Database Connectivity) Adapter is a component in webMethods Integration Server that facilitates seamless integration between the Integration Server and relational databases. It enables the Integration Server to connect to and interact with various databases using standard JDBC technology.
The JDBC Adapter empowers developers to effortlessly set up connections to diverse database systems and execute SQL queries or stored procedures. By abstracting the underlying database complexity, it ensures a consistent and standardized interface, streamlining data retrieval and manipulation tasks.
Key features of the JDBC Adapter :
- Connection Management: Simplifies the process of creating, configuring, and managing database connections within webMethods Integration Server.
- SQL Operations: Supports executing SQL queries, updates, inserts, and deletes, allowing the Integration Server to interact with the connected databases.
- Stored Procedures: Enables the execution of stored procedures and functions present in the connected database.
- Transaction Handling: Facilitates transaction management, ensuring data consistency and integrity during complex operations involving multiple database interactions.
- NO_TRANSACTION : It refers to auto-commit mode, where each SQL statement is treated as a separate transaction. Changes are automatically committed, and failed statements don’t affect others.
- LOCAL_TRANSACTION :It refers to a transaction mode where multiple SQL statements are executed together as a single unit of work. Changes made by these statements are isolated from other transactions until they are explicitly committed, ensuring data integrity and consistency. If any part of the transaction fails, a rollback can be performed to undo all the changes made within that transaction.
- XA_TRANSACTION : It refers to a distributed transaction mode that allows multiple resources, such as databases or messaging systems, to participate in a single global transaction. It ensures atomicity and consistency across all resources, even if one or more of them are distributed and managed by different systems.
Prerequisites for JDBC connection setup :
- Ensure you have set up a relational database and gathered the necessary connection details, such as the host name, port, database name, username, and password.
- Make sure you have the jar file for your version of database, you can just search over the internet with keyword like “mysql 5.0 jar” and download the jar file.
Steps to create JDBC Connection :
- Please create a package with the following folder structure to facilitate upcoming exercises on JDBC.
- Now open your integration server page and click on “webMethods Adapter for Jdbc” under “Adapters” tab and click on “Configure New Connection”.
- If your database is installed on your local system or if it is not SSL secured, click on “webMethods Adapter for JDBC Connection.” However, if your database is SSL secured, click “webMethods Adapter for JDBC Connection” to proceed.
- To configure the JDBC Adapter, follow these steps and provide the following details as required.
- Package : Select the package which which you have created for this exercise(JDBCDemo).
- Folder Name: Specify the desired folder path within the package ( JDBCDemo.connection) where you wish to store the connection settings.
- Connection Name: Provide a suitable name for your connection (DemoConnection).
- Transaction Type : Choose the transaction type according to your needs; for this demonstration, I will select “NO_TRANSACTION.”
- Driver Group : Leave it as Default.
- DataSource Class : Provide the appropriate data source class name for your specific database and connection type, as it can vary depending on the database and connection setup. For this demonstration, I am using “Postgres SQL” with a “NO_TRANSACTION” connection type, so the data source class will be “org.postgresql.ds.PGPoolingDataSource.”Click Here and find your Data source Class.
- Server Name : Provide you database host name(localhost).
- User : Provide user name using which adapter will connect to the database.
- Password : Provide password for your database.
- Retype Password : Confirm the password you entered earlier.
- Database Name : Provide the database name.
- Port Number : Provide the database port number.
- Network Protocol : TCP(optional).
- Other Properties : optional.
- You can either leave the other fields as they are or configure them based on your specific requirements.
- Now we have configured the required field so click on “Save Connection”
- Before enabling the connection, ensure you have the required jar in place; otherwise, it will result in an error. So, let’s place the necessary jar file first.
- Copy your jar file and paste it into the following path: ‘C:SoftwareAGIntegrationServerinstancesdefaultpackagesWmJDBCAdaptercodejars’, this path may differ as per your installation directory.
- Now restart you integration server and wait for it to be up and running, and then proceed to enable the connection.Please click here to checkout our article and learn the process for restarting the integration server.
- Now, refresh the connection folder in your package, and you will observe that a connection has been created with the name you specified during the configuration process.
Now JDBC configuration part is done so in the next article, we will explore how to utilize this connection to create adapters and perform transactions with the database.
Stay Tuned!!!😊
Hello,
It is with sad regret that after 12 years, LeadsMax.biz is shutting down.
We have made all our databases available on our website.
25 Million companies
527 Million People
LeadsMax.biz