Configuring Metering Database

This section helps you to configure the database properties to use the database.

Metering is a sql based product microservice. So we need to configure database properties in the properties file to use the database. We use Spring beans to load the entity files and create table at the time of deployment. So once you configure the below mentioned database properties and deploy the war in the application. The tables will be created once the application is successfully deployed.

Databases supported are MySql and Oracle.

Installing MySql Database

Procedure:

  1. Go to the mysql website.
  2. Download and Install the database with the help of supported documents available in the mysql website.
  3. Once installed, configure the user and other properties for the database based on your requirement.
  4. Define the following properties in the db.properties file, which is available in the war files mentioned in this user guide.

    S.No

    Database Property

    Value

    Description

    1

    database.name

    metering

    The database name to which the war needs to connect to

    2

    driver.name

    com.mysql.jdbc.Driver

    the driver used to establish connection with db

    3

    dialect

    org.hibernate.dialect.MySQL5InnoDBDialect

    the dialect used in db connection

    4

    db.connection.url

    jdbc:mysql://db-service:3306/metering

    jdbc connection url with host and port

    5

    db.username

    root

    database username

    6

    db.password

    root

    database password

    Using the above properties, you can connect to the database and perform the business operations for Metering Microservices.

Installing Oracle Database

Procedure:

  1. Go to the orcale website.
  2. Download and install the database with the help of supported documents available in the oracle website.
  3. Once installed, configure the user and other properties for the database based on your requirement.
  4. Define the following properties in the db.properties file, which is available in the war files mentioned in this user guide.

    S.No

    Database Property

    Value

    1

    driver.name

    oracle.jdbc.driver.OracleDriver

    2

    dialect

    org.hibernate.dialect.Oracle10gDialect

    3

    db.connection.url

    jdbc:oracle:thin:@localhost:1521:metering


Bookmark Name Actions
Feedback
x