Step-by-step instructions on how to easily integrate and configure Connect for JDBC MongoDB driver 6.0 with JBoss EAP 6.4.0.
This is the latest from our tutorial rumble where our engineers put their heads together and thought of ways to help our customers succeed. Don't see the tutorial you need? Contact us and we will be glad to help.
The set up steps detailed and demonstrated below are for a Windows machine. The 4 main steps include:
While the focus is on MongoDB here, the same steps apply to any of the data sources that Connect for JDBC supports.
JBoss EAP 6.4.0 is the Enterprise version of JBoss AS Wildfly 7.5.0 (so internally most of its components are the same as JBoss AS 7.5.0 ). The configuration steps will also apply to JBoss AS Wildfly 7.5.0.
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
module
xmlns
=
"urn:jboss:module:1.0"
name
=
"com.mongodb"
>
<
resources
>
<
resource-root
path
=
"mongodb.jar"
/>
</
resources
>
<
dependencies
>
<
module
name
=
"javax.api"
/>
<
module
name
=
"javax.transaction.api"
/>
</
dependencies
>
</
module
>
/subsystem=datasources/jdbc-driver=mongodb:add(driver-name=mongodb,driver-module-name=com.mongodb,driver-xa-datasource-class-name=com.mongo.jdbc.jdbc2.optional.MongodbXADataSource)
GENERAL SYNTAX/ FORMAT of the CLI command is as indicated below: /subsystem=datasources/jdbc-driver=DRIVER_NAME:add(driver-name=DRIVER_NAME,driver-module-name=MODULE_NAME,driver-xa-datasource-class-name=XA_DATASOURCE_CLASS_NAME)
Example:
Name—MyMongoJDBCDS
JNDI Name—java:jboss/datasources/MyMongoJDBCDS
Example: Connection URL: jdbc:datadirect:mongodb://<Machinename>:<port>;schemaDefinition=<User_Specified location>
Username and Password required to connect to the MongoDB database
The screenshot here shows that the schemaDefinition location is specified as C:\MongoJdbcSchema.
This will create the .map, .properties, .script, .config and .native files in location C:/ as shown in screenshot below with the suffix MongoJdbcSchema
You may choose to directly edit the standalone.xml directly to make changes to the datasource instead of using the Admin Console GUI
Screenshot of the standalone.xml below:
MongoDB connectivity via JDBC or ODBC is easier than ever with DataDirect JDBC and ODBC connectors for MongoDB. They provide fast SQL access to business critical data while also enabling you to access NoSQL data without additional server installations. Integrate your MongoDB data without having to duplicate data or flatten complex documents. Visit our information page to learn more or try it free for 15 days.
Try Now—JDBC
Try Now—ODBC
Jan is a Sr. Support Engineer at Progress. She is responsible for assisting Progress customers and application partners solve technical issues by providing efficient and effective technical support. She has background in the areas of Business Rules, Database Drivers, Business Process Management, Complex Event Processing.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites