H2 Database Configuration For IBM Curam


Introduction


H2 is a Relational Database Management system(RDBMS) purely written in Java. It can be embedded in java application or run as a client server application mode.

It is having very important and light weight feature like –

  • Very fast, open source, JDBC API
  • Embedded and server modes; in-memory databases
  • Browser based Console application
  • Small footprint: around 1.5 MB jar file size

IBM Curam also use H2 Database along with Oracle and DB2. Though using Oracle or DB2 for testing would be the more correct approach, having a heavy enterprise grade database running on your workstation can take up so much of your limited resources. H2 Database save money and time while developing project using Curam Framework.

 


H2 Database Configuration For IBM Curam


H2 Database Jar already available under CuramSDEJ/drivers folder and we can start H2 Database Server using Windows command prompt or UNIX console depend on operating system. We are explaining using Windows Operating System.

2016-09-15-09_47_06-curam-spec

Please follow steps to configure H2 Database

Step1: Verify H2X.Y.Z.jar file as per above Image under CuramSDEJ/drivers folder.

Step2: Start H2 Database Server using “java -jar D:\Curam\CuramSDEJ\drivers\h2-1.3.176.jar” command on Windows Command Prompt. Once we executed above command then it start H2 Database Server, please find Screenshot below –

2016-09-15-09_57_33-curam-spec

Step3: We need to Update Bootstrap.properties which user can find under EJBServer/project/properties. Please find Sample Bootstrap.properties file for H2 Database below –

2016-09-15-09_27_15-curam-spec

  • curam.db.type: This property has the value of Database Type like h2, db2 or ora
  • curam.db.name: This property has the value of Database name for example curamdb.
  • curam.db.username: This property has username of the above configured database.
  • curam.db.password: This property has the encrypted passed which user want to associate with above user.
  • curam.db.h2.directory: This property has the directory structure where user store data.
  • curam.db.serverport: H2 Database server port, by default 9092 or 8082.
  • curam.db.servername: This property has host name like localhost or server ip/name.

Step4: Please execute ant Target Configtest to verify our configuration. Once ConfigTest Passed then execute Clean Server Database Ant Target to generate artifacts based on H2.

It create Database Schema and setup username given password and create Database under given directory(curam.db.h2.directory). Please find screenshot below -

2016-09-15-10_53_02-curam-spec

Step5: Complete other required Build and Navigate Curam Application with H2 Database.

 


H2 Console Explanation


We can access H2 Database using Web Console to execute SQL.

You can access the H2 Web Console at the following URL:

http://localhost:8082/

Use your credentials which we configure in Bootstrap.properties file. Once login then Web Console looks like below screenshot –

  •  Login Screen: Once hit the above URL then it navigate to Login Screen, user can use credentails from Bootstrap.properties.

2016-09-15-11_12_31-curam-spec

  • H2 Web Console: Once Login successful then it navigate to Web console where we can execute database related activity like SQL.

2016-09-15-11_13_21-curam-spec

 

Note: We can configure it as Windows Service so it start automatically.

Leave a Reply

Your email address will not be published. Required fields are marked *