Wednesday, June 14, 2023

MS - Springboot + Hibernate + Rest web service chapter 1

 Create a simple REST web service using springboot.

Use spring initializer   https://start.spring.io/

Dependencies

Web, JPA, database ( Mysql Connctor ) 

for your wish you can use, lombok, actuator, devtools

Webservice will include simple CRUD operation alias with REST POST,GET, PUT, GET

Tech Stack

Java 8, Maven, Springboot 3.10 , 


Sample code as below

POM file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.demo.micro</groupId>
<artifactId>student</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>student</name>
<description>Student Service</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.31</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>


Application properties

server.port=8203
spring.datasource.url=jdbc:mysql://localhost:3306/student_mgt
spring.datasource.username=root
spring.datasource.password=root

# for Spring Boot 2
# spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQL5InnoDBDialect
# for Spring Boot 3
spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQLDialect
spring.jpa.show-sql=false
spring.jpa.generate-ddl=true
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl



Code base Structure

com.demo.micro.student

controller --> will include REST API

model --> model classes

repository --> repo file, db connection

service --> service classes

MainApllication --> StudentApplication with @SpringBootApplication


Controller

package com.demo.micro.student.controller;

import com.demo.micro.student.model.Student;
import com.demo.micro.student.service.StudentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Optional;

@RestController
@RequestMapping("/students")
public class StudentController {

@Autowired
StudentServiceImpl studentService;

@GetMapping("")
public ResponseEntity<List<Student>> list() {
return new ResponseEntity<List<Student>>(studentService.list(), HttpStatus.OK);
}

@PostMapping("")
public ResponseEntity<Student> resgiterStudent(@RequestBody Student student) {
try {
Student st = studentService.createStudent(student);
return new ResponseEntity<>(st, HttpStatus.CREATED);
} catch (Exception e) {
return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);
}
}

@PutMapping("")
public ResponseEntity<Student> updateStudent(@RequestBody Student student) {
return new ResponseEntity<>(studentService.createStudent(student), HttpStatus.OK);
}

@PutMapping("/{id}")
public ResponseEntity<Student> updateStudent(@PathVariable("id") int id, @RequestBody Student student) {
Optional<Student> st = studentService.findById(id);
if (st.isPresent()) {
// set details for student
return new ResponseEntity<>(studentService.createStudent(student), HttpStatus.OK);
} else {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
}

/**
* Don't do this. We normally makes a soft delete -
* 1. update flag/property as deleted. But flag is redundant field
* 2. use date/time option. nullable date time or default old time.
*
* @param student
* @return
*/
@DeleteMapping("")
public ResponseEntity<Student> deleteStudent(@RequestBody Student student) {
studentService.deleteStudent(student);
return new ResponseEntity<>(null, HttpStatus.ACCEPTED);
}
}


Model

package com.demo.micro.student.model;

import jakarta.persistence.*;
import lombok.Data;

/**
* Student details.
*/
@Entity
@Table(name = "student")
@Data
public class Student {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "student_id")
private int studentId;

/**
* First name of the student.
*/
@Column(name = "first_name")
private String firstName;

/**
* Last name of the student.
*/
@Column(name = "last_name")
private String lastName;


}

Repository

package com.demo.micro.student.repository;

import com.demo.micro.student.model.Student;
import org.springframework.data.jpa.repository.JpaRepository;

public interface StudentRepository extends JpaRepository<Student,Integer> {
}


Service classes - Interface and Impl

package com.demo.micro.student.service;

import com.demo.micro.student.model.Student;

import java.util.List;
import java.util.Optional;

/**
*
*/
public interface StudentService {

/**
* Returns a list of {@link Student}s.
* @return list of {@link Student}
*/
List<Student> list();
Student createStudent(Student student);

Optional<Student> findById(int studentId);

void deleteStudent(Student student);
}


package com.demo.micro.student.service;

import com.demo.micro.student.model.Student;
import com.demo.micro.student.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class StudentServiceImpl implements StudentService {

@Autowired
StudentRepository studentRepository;

/**
* List all the {@link Student}
*
* @return
*/
@Override
public List<Student> list() {
return studentRepository.findAll();
}

/**
* Create a new record of {@link Student}.
*
* @param student
* @return
*/
@Override
public Student createStudent(Student student) {
return studentRepository.save(student);
}

@Override
public Optional<Student> findById(int studentId) {
return studentRepository.findById(studentId);
}

public void deleteStudent(Student student) {
studentRepository.delete(student);
}

}


Important : Note that we put @Srvivie at Impl class, not Interface


Main class

package com.demo.micro.student;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class StudentApplication {

public static void main(String[] args) {
SpringApplication.run(StudentApplication.class, args);
}

}






Friday, May 26, 2023

Windows Process useful commands

 

windows find port usage

netstat -aon | findstr<port_number>

eg: netstat -ano | findstr 8081


windows check details of process id

tasklist /fi "pid eq <process id>"

eg: tasklist /fi "pid eq 4716"


Kill Process forcefully

taskkill /im myprocess.exe /f

The "/f" is for "force". If you know the PID, then you can specify that, as in:

taskkill /pid 4716 /f

Sunday, March 26, 2023

Jenkins - Install Plugin manually

 you might work in environment/ company where internet and some of the connections are blocked.

In a scenario, where you would have no option rather than going through manual installation. It's really a hard stuff, but no choice. It's like when you trying to add a dependency to build environment and not allowed where you will end up in adding all the hierarchy of dependencies. Really a night mare and mostly you will hate wasting time for nothing.

Here i will add a few pieces where i would try to add "git" plugin manually.

If you use normal way, it will do it few seconds or minutes time depending on the speed of the internet, but manual installation will not take hours, but days to install a certain plugin.

Plugin : GIT

 Link : https://plugins.jenkins.io/git/

 

https://plugins.jenkins.io/git/

 




In top right corner , you will see a button “How to Install “

Click and go under 3rd option.

 

Advanced installation

The Update Center only allows the installation of the most recently released version of a plugin. In cases where an older release of the plugin is desired, a Jenkins administrator can download an older .hpi archive and manually install that on the Jenkins controller.

Jenkins stores plugins it has downloaded in the plugins directory with a .jpi suffix, whether the plugins originally had a .jpi or an .hpi suffix.

If an administrator manually copies a plugin archive into the plugins directory, it should be named with a .jpi suffix to match the file names used by plugins installed from the update center.

From the web UI

Assuming a .hpi file has been downloaded, a logged-in Jenkins administrator may upload the file from within the web UI:

  1. Navigate to the Manage Jenkins > Plugins page in the web UI.
  2. Click on the Advanced tab.
  3. Choose the .hpi file from your system or enter a URL to the archive file under the Deploy Plugin section.
  4. Deploy the plugin file.




Once a plugin file has been uploaded, the Jenkins controller must be manually restarted in order for the changes to take effect.

 

 

 

Some plugins could not be loaded due to unsatisfied dependencies. Fix these issues and restart Jenkins to re-enable these plugins.

Dependency errors:

 

 



 

 

 

 

Git plugin (5.0.0)

Plugin is missing: workflow-scm-step (400.v6b_89a_1317c9a_)

Plugin is missing: credentials (1189.vf61b_a_5e2f62e)

Plugin is missing: mailer (438.v02c7f0a_12fa_4)

Plugin is missing: ssh-credentials (305.v8f4381501156)

Plugin is missing: workflow-step-api (639.v6eca_cd8c04a_a_)

Plugin is missing: scm-api (631.v9143df5b_e4a_a)

Plugin is missing: script-security (1228.vd93135a_2fb_25)

Plugin is missing: credentials-binding (523.vd859a_4b_122e6)

Plugin is missing: git-client (4.0.0)

Plugin is missing: structs (324.va_f5d6774f3a_d)

 

Now you have to install these plugins one by one.

You can find the all the plugins in below url , this will save your effort finding plugins.
Important : make sure you check the plugin version also

https://updates.jenkins.io/download/plugins/

Friday, August 19, 2022

Springboot app with hibernate 3 - sample sql

 1.sample sql - projAllocDetails.sql


SELECT [ProjectId]

      ,[EmployeeId]

      ,[AllocationStartDate]

      ,[AllocationEndDate]

      ,[AllocationType]

      ,[ProjectRole]

      ,[IsSheduledRole]

FROM [myapp].[myapp].[tblProjectAllocations]


2. ProjectAllocationsRepository 


package com.myapp.dxt.central_scheduler.repository;


import com.myapp.dxt.central_scheduler.model.ProjectAllocations;

import org.springframework.data.jpa.repository.JpaRepository;

import org.springframework.data.jpa.repository.Modifying;

import org.springframework.data.jpa.repository.Query;

import org.springframework.stereotype.Repository;


import javax.transaction.Transactional;


@Repository

public interface ProjectAllocationsRepository extends JpaRepository<ProjectAllocations,Integer> {


    @Transactional

    @Modifying

    @Query(value = "truncate table project_allocations", nativeQuery = true)

    void truncateDeleteEffortsDetail();

}


3.Allocation DTO class


package com.myapp.dxt.central_scheduler.model;


import javax.persistence.*;

import java.io.Serializable;

import java.sql.Timestamp;


/**

 * SELECT [ProjectId]

 * ,[EmployeeId]

 * ,[AllocationStartDate]

 * ,[AllocationEndDate]

 * ,[AllocationType]

 * ,[ProjectRole]

 * ,[IsSheduledRole]

 * FROM [myapp].[myapp].[tblProjectAllocations]

 */

@Entity

@Table(name = "project_allocations")

public class ProjectAllocations implements Serializable {


    @Id

    @GeneratedValue(strategy = GenerationType.AUTO)

    private int projectAllocationsId;


    @Column(name = "projectId")

    private Integer projectId;


    @Column(name = "employeeId")

    private Integer employeeId;


    @Column(name = "allocationStartDate")

    private Timestamp allocationStartDate;


    @Column(name = "allocationEndDate")

    private Timestamp allocationEndDate;


    @Column(name = "allocationType")

    private String allocationType;


    @Column(name = "projectRole")

    private String projectRole;


    @Column(name = "isSheduledRole")

    private int isSheduledRole;


    public int getProjectAllocationsId() {

        return projectAllocationsId;

    }


    public void setProjectAllocationsId(int projectAllocationsId) {

        this.projectAllocationsId = projectAllocationsId;

    }


    public Integer getProjectId() {

        return projectId;

    }


    public void setProjectId(Integer projectId) {

        this.projectId = projectId;

    }


    public Integer getEmployeeId() {

        return employeeId;

    }


    public void setEmployeeId(Integer employeeId) {

        this.employeeId = employeeId;

    }


    public Timestamp getAllocationStartDate() {

        return allocationStartDate;

    }


    public void setAllocationStartDate(Timestamp allocationStartDate) {

        this.allocationStartDate = allocationStartDate;

    }


    public Timestamp getAllocationEndDate() {

        return allocationEndDate;

    }


    public void setAllocationEndDate(Timestamp allocationEndDate) {

        this.allocationEndDate = allocationEndDate;

    }


    public String getAllocationType() {

        return allocationType;

    }


    public void setAllocationType(String allocationType) {

        this.allocationType = allocationType;

    }


    public String getProjectRole() {

        return projectRole;

    }


    public void setProjectRole(String projectRole) {

        this.projectRole = projectRole;

    }


    public int getIsSheduledRole() {

        return isSheduledRole;

    }


    public void setIsSheduledRole(int isSheduledRole) {

        this.isSheduledRole = isSheduledRole;

    }

}


4. Service class


package com.myapp.dxt.central_scheduler.service;

import com.myapp.dxt.central_scheduler.db.MyAppExtractor;
import com.myapp.dxt.central_scheduler.model.ProjectDetails;
import com.myapp.dxt.central_scheduler.repository.ProjectDetailsRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

import static com.myapp.dxt.central_scheduler.util.Constant.MY_APP_PROJECT_DETAILS;

@Service
public class ProjectDetailsService {
private static final Logger logger = LoggerFactory.getLogger(ProjectDetailsService.class);

ProjectDetailsService() {
}

@Autowired
ProjectDetailsRepository projectDetailsRepository;

private static List<Map<String, Object>> projectDetailsList = null;

public static List<Map<String, Object>> getProjectDetailsList() {
return projectDetailsList;
}

public static void setProjectDetailsList(List<Map<String, Object>> projectDetailsList) {
ProjectDetailsService.projectDetailsList = projectDetailsList;
}

public void run() {
// extract details from myapp db
extract();
//Save data to db
save();
}

public void extract() {
logger.info("Extracting project details data");
MyAppExtractor myApp= new MyAppExtractor();
List<Map<String, Object>> extractedList = myApp.process(MY_APP_PROJECT_DETAILS);
setProjectDetailsList(extractedList);
}

public void save() {
if (!getProjectDetailsList().isEmpty()) {
logger.info("Delete existing project details table records");
projectDetailsRepository.truncateDeleteEffortsDetail();
Timestamp now = new Timestamp(System.currentTimeMillis());
for (Map<String, Object> record : getProjectDetailsList()) {
Integer projectId = (Integer) record.get("ProjectId");
String projectName = (String) record.get("ProjectName");
String account = (String) record.get("Account");
String segment = (String) record.get("Segment");
String sbu = (String) record.get("SBU");
String groupSbu = (String) record.get("GroupSBU");
String business = (String) record.get("Business");
String atc = (String) record.get("ATC");
String projectLocation = (String) record.get("ProjectLocation");
String processTemplate = (String) record.get("ProcessTemplate");
Timestamp chorusMigrationDate = (Timestamp) record.get("ChorusMigrationDate");
Timestamp chorusClosedDate = (Timestamp) record.get("ChorusClosedDate");
String practice = (String) record.get("Practice");
String chorusStatus = (String) record.get("ChorusStatus");
String managedBy = (String) record.get("ManagedBy");
Integer totalTeamSize = (Integer) record.get("TotalTeamSize");
String contractType = (String) record.get("ContractType");
String largeProgram = (String) record.get("LargeProgram");
String projectManager = (String) record.get("ProjectManager");
String velocityProjectCode = (String) record.get("VelocityProjectcode");
String velocityStatus = (String) record.get("VelocityStatus");
String projectDuration = (String) record.get("ProjectDuration");
String primaryProjectManager = (String) record.get("PrimaryProjectManager");
String mitigationTiming = (String) record.get("MitigationTiming");
String mitigationStage = (String) record.get("MitigationStage");
String asmWorkType = (String) record.get("ASMWorkType");
String underDxtPurview = (String) record.get("UnderDxTpurview");
String reasonForNotSupporting = (String) record.get("ReasonforNotSupporting");
String reason = (String) record.get("Reason");
String projectComingUnderDecPurvieWas = (String) record.get("ProjectComingUnderDECPurviewas");
String projectAccessForFacilitationAndAudits = (String) record.get("ProjectAccessforFacilitationandAudits");
String dec = (String) record.get("DEC");
String projectStartChampion = (String) record.get("ProjectStartChampion");
String acceleratorsChampion = (String) record.get("AcceleratorsChampion");
String sbuDecHead = (String) record.get("SBUDECHead");
String canDecAttendClientMeetings = (String) record.get("CanDECAttendClientMeetings");
String isTheProjectCanShowTheArtefactsUsingRemoteSharing = (String) record.get("IstheProjectCanShowtheArtefactsUsingRemoteSharing");
String accessPermissionsComments = (String) record.get("AccessPermissionsComments");
String remoteSharingComments = (String) record.get("RemoteSharingComments");
String startRightApplicability = (String) record.get("StartRightApplicability");
String reasonForSrNotApplicable = (String) record.get("ReasonforSRNotApplicable");
String startRightChampion = (String) record.get("StartRightChampion");
Timestamp velocityStartDate = (Timestamp) record.get("VelocityStartDate");
Timestamp velocityEndDate = (Timestamp) record.get("VelocityEndDate");

ProjectDetails projectDetailsEntity = new ProjectDetails();
projectDetailsEntity.setProjectId(projectId);
projectDetailsEntity.setProjectName(projectName);
projectDetailsEntity.setAccount(account);
projectDetailsEntity.setSegment(segment);
projectDetailsEntity.setSbu(sbu);
projectDetailsEntity.setGroupSbu(groupSbu);
projectDetailsEntity.setBusiness(business);
projectDetailsEntity.setAtc(atc);
projectDetailsEntity.setProjectLocation(projectLocation);
projectDetailsEntity.setProcessTemplate(processTemplate);
projectDetailsEntity.setChorusMigrationDate(chorusMigrationDate);
projectDetailsEntity.setChorusClosedDate(chorusClosedDate);
projectDetailsEntity.setPractice(practice);
projectDetailsEntity.setChorusStatus(chorusStatus);
projectDetailsEntity.setManagedBy(managedBy);
projectDetailsEntity.setTotalTeamSize(totalTeamSize);
projectDetailsEntity.setContractType(contractType);
projectDetailsEntity.setLargeProgram(largeProgram);
projectDetailsEntity.setProjectManager(projectManager);
projectDetailsEntity.setVelocityProjectCode(velocityProjectCode);
projectDetailsEntity.setVelocityStatus(velocityStatus);
projectDetailsEntity.setProjectDuration(projectDuration);
projectDetailsEntity.setPrimaryProjectManager(primaryProjectManager);
projectDetailsEntity.setMitigationTiming(mitigationTiming);
projectDetailsEntity.setMitigationStage(mitigationStage);
projectDetailsEntity.setAsmWorkType(asmWorkType);
projectDetailsEntity.setUnderDxtPurview(underDxtPurview);
projectDetailsEntity.setReasonForNotSupporting(reasonForNotSupporting);
projectDetailsEntity.setReason(reason);
projectDetailsEntity.setProjectComingUnderDecPurvieWas(projectComingUnderDecPurvieWas);
projectDetailsEntity.setProjectAccessForFacilitationAndAudits(projectAccessForFacilitationAndAudits);
projectDetailsEntity.setDeCoach(dec);
projectDetailsEntity.setProjectStartChampion(projectStartChampion);
projectDetailsEntity.setAcceleratorsChampion(acceleratorsChampion);
projectDetailsEntity.setSbuDecHead(sbuDecHead);
projectDetailsEntity.setCanDecAttendClientMeetings(canDecAttendClientMeetings);
projectDetailsEntity.setIsTheProjectCanShowTheArtefactsUsingRemoteSharing(isTheProjectCanShowTheArtefactsUsingRemoteSharing);
projectDetailsEntity.setAccessPermissionsComments(accessPermissionsComments);
projectDetailsEntity.setRemoteSharingComments(remoteSharingComments);
projectDetailsEntity.setStartRightApplicability(startRightApplicability);
projectDetailsEntity.setReasonForSrNotApplicable(reasonForSrNotApplicable);
projectDetailsEntity.setStartRightChampion(startRightChampion);
projectDetailsEntity.setVelocityStartDate(velocityStartDate);
projectDetailsEntity.setVelocityEndDate(velocityEndDate);

logger.info("Upserting project details " + projectDetailsEntity.getProjectId() + "...");
try {
projectDetailsRepository.save(projectDetailsEntity);
logger.info("Status: CREATED");
} catch (RuntimeException e) {
throw new RuntimeException("Failed to upsert project details data with project id=" + projectDetailsEntity.getProjectId() + "...");
}
}
}
}
}

Springboot app with hibernate 2 -pom.xml

 pom.xml


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.myapp.dxt</groupId>
<artifactId>central_scheduler</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>central_scheduler</name>
<description>central scheduler</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.10</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.olap4j</groupId>
<artifactId>olap4j</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>org.olap4j</groupId>
<artifactId>olap4j-xmla</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>

Springboot app with hibernate 1

 1. application.properties

server.port=8203
spring.datasource.url=jdbc:mysql://localhost:3306/central_scheduler
spring.datasource.username=root
spring.datasource.password=root@123

spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.show-sql=false
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

logging.level.root=warn
logging.level.com.myapp.dxt.central_scheduler=debug