Spring database converter
Author: m | 2025-04-25
Here, I have written code for to convert data from CSV file to MySQL database and MySQL database to CSV file. - londhea/spring-batch-database-to-csv-and-csv-to-database-spring-boot
londhea/spring-batch-database-to-csv-and-csv-to-database-spring
IntroductionThis tutorial will show you how you can work with embedded HSQLDB with Spring framework. This application will show you a CRUD (Create, Read, Update and Delete) operation using embedded HSQLDB.Sometimes you need to work with an in memory database when you want to demonstrate certain database centric features of an application during development phase. Such situation may be when there is no access to real database server and you want to perform test on an application on the fly using database operations then this may be very helpful.Spring supports many databases such as HSQL, H2, and Derby as default embedded databases but, we can also use an extensible third party API to plug in new embedded database and DataSource implementations.PrerequisitesJava at least 8, Spring Boot 2.3.3, HSQLDB 2.5.1, Gradle 6.5.1, Maven 3.6.3Project SetupYou can create either gradle or maven based project in your favorite IDE or tool. The name of the project is spring-embedded-hsqldb.You can use the following build.gradle script for your project if it is a gradle based project:buildscript { ext { springBootVersion = '2.3.3.RELEASE' } repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") }}plugins { id 'java-library' id 'org.springframework.boot' version "${springBootVersion}"}sourceCompatibility = 12targetCompatibility = 12repositories { mavenCentral()}dependencies { implementation("org.springframework.boot:spring-boot-starter:${springBootVersion}") implementation("org.springframework.boot:spring-boot-starter-jdbc:${springBootVersion}") implementation 'org.hsqldb:hsqldb:2.5.1'}You can use the following pom.xml file if it is a maven based project: 4.0.0 com.roytuts spring-embedded-hsqldb 0.0.1-SNAPSHOT org.springframework.boot spring-boot-starter-parent 2.3.3.RELEASE UTF-8 org.springframework.boot spring-boot-starter org.springframework.boot spring-boot-starter-jdbc org.hsqldb hsqldb 2.5.1 org.apache.maven.plugins maven-compiler-plugin 3.8.1 at least 8 at least 8 Database ConfigurationThe following class configures database beans for creating datasource.package com.roytuts.spring.embedded.hsqldb.config;import javax.sql.DataSource;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.jdbc.core.JdbcTemplate;import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;@Configurationpublic class Config { @Bean public DataSource dataSource() { EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder(); EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript("classpath:table.sql") .addScript("classpath:data.sql").build(); return db; } @Bean public JdbcTemplate jdbcTemplate(DataSource dataSource) { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); return jdbcTemplate; }}As I am using in-memory database, so I did not need to configure any database connection details. The default values will be used for connection details.I am using SQL scripts to create a table and storing some sample data. The SQL scripts are kept under src/main/resources folder.table.sqlDROP TABLE CUSTOMER IF EXISTS;CREATE TABLE CUSTOMER ( CUSTOMER_ID integer identity primary key, CUSTOMER_NAME varchar(50) not null, CUSTOMER_ADDRESS varchar(255), CUSTOMER_CITY varchar(50) not null, CUSTOMER_STATE varchar(50) not null, CUSTOMER_ZIP_POSTAL varchar(30) not null);data.sqlINSERT INTO CUSTOMER VALUES(1,'Sumit Ghosh','Garfa','Kolkata','West Bengal','700085')INSERT INTO CUSTOMER VALUES(2,'Gourab Guha','Garia','Kolkata','West Bengal','700145')INSERT INTO CUSTOMER VALUES(3,'Debina Guha','Kestopur','Kolkata','West Bengal','700185')INSERT INTO CUSTOMER VALUES(4,'Debabrata Poddar','Birati','Kolkata','West Bengal','700285')INSERT INTO CUSTOMER VALUES(5,'Amit Dharmale','Thane','Mumbai','Maharastra','400140')Model ClassI have created a model class for mapping Java fields to database table columns.package com.roytuts.spring.embedded.hsqldb.model;public class Customer { private Long customerId; private String customerName; private String customerAddress; private String customerCity; private String customerState; private String customerZip; // getters and setters @Override public String toString() { return "[ Customer Id : " + customerId + ", Customer Here, I have written code for to convert data from CSV file to MySQL database and MySQL database to CSV file. - londhea/spring-batch-database-to-csv-and-csv-to-database-spring-boot By annotating this converter with @ReadingConverter you instruct Spring Data to convert every String value from the database that should be assigned to a Boolean property. Registering Spring Converters with the JdbcConverter MS SQL to MySQL Database Converter is a program to migrate entire or selected database records of MS SQL into MySQL database records. Software provides option to convert views, schemas, stored procedures and Indexes with all necessary attributes. MySQL to MS SQL Database Converter migrates MySQL database records into Microsoft SQL Server database records. Software provide option to convert 4.1 or earlier version of MySQL database. Database utility converts views and indexes with all major attributes. MS Access to MySQL Database Converter converts MS Access database into the MySQL database and save converted database at user specified location. Tool with its advance features is capable to convert MS Access password protected database files. MySQL to MS Access Database Conversion Software converts MySQL database records to MS Access format without writing database queries. Software convert selected or entire database div records with support for all data types, attributes and key constraints. MySQL to MS Excel database converter convert My SQL existing database records into Microsoft Excel Spreadsheet. With an easy to use windows interface, the user just selects database record and click on Convert button to convert entire or selected records to Microsoft excel spreadsheet. MS Excel to MySQL Database Converter Database Converter Software convert data base records created in MS Excel to MySQL server without modifying database integrity. You can easily convert all your database information with support to major version of MSExcel and MySQL server. Excel to Windows Contacts converter software migrate entire contact information from excel file into windows contacts. Software is designed to convert all contact fields including Names, Phone Numbers, Emails, Address etc stored in excel spreadsheets into windows contacts. Oracle to MySQL Database Converter Software converts oracle database records into MySQL database format. Software supports all database attributes, database key constraints, indexes, schemas, null value and primary key constraints. Excel Converter Software is useful to convert excel file from xls to xlsx and xlsx to xls format.Excel Converter Program helps you to convert multiple numbers of XLS files to XLSX and XLSX files to XLS in a batch process in few simple steps. Excel to Phonebook converter software migrate entire contact information from excel file into phonebook. Software is capable to convert all contact fields including names, phone numbers, email address etc stored in excel spreadsheets into phonebook files.Comments
IntroductionThis tutorial will show you how you can work with embedded HSQLDB with Spring framework. This application will show you a CRUD (Create, Read, Update and Delete) operation using embedded HSQLDB.Sometimes you need to work with an in memory database when you want to demonstrate certain database centric features of an application during development phase. Such situation may be when there is no access to real database server and you want to perform test on an application on the fly using database operations then this may be very helpful.Spring supports many databases such as HSQL, H2, and Derby as default embedded databases but, we can also use an extensible third party API to plug in new embedded database and DataSource implementations.PrerequisitesJava at least 8, Spring Boot 2.3.3, HSQLDB 2.5.1, Gradle 6.5.1, Maven 3.6.3Project SetupYou can create either gradle or maven based project in your favorite IDE or tool. The name of the project is spring-embedded-hsqldb.You can use the following build.gradle script for your project if it is a gradle based project:buildscript { ext { springBootVersion = '2.3.3.RELEASE' } repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") }}plugins { id 'java-library' id 'org.springframework.boot' version "${springBootVersion}"}sourceCompatibility = 12targetCompatibility = 12repositories { mavenCentral()}dependencies { implementation("org.springframework.boot:spring-boot-starter:${springBootVersion}") implementation("org.springframework.boot:spring-boot-starter-jdbc:${springBootVersion}") implementation 'org.hsqldb:hsqldb:2.5.1'}You can use the following pom.xml file if it is a maven based project: 4.0.0 com.roytuts spring-embedded-hsqldb 0.0.1-SNAPSHOT org.springframework.boot spring-boot-starter-parent 2.3.3.RELEASE UTF-8 org.springframework.boot spring-boot-starter org.springframework.boot spring-boot-starter-jdbc org.hsqldb hsqldb 2.5.1 org.apache.maven.plugins maven-compiler-plugin 3.8.1 at least 8 at least 8 Database ConfigurationThe following class configures database beans for creating datasource.package com.roytuts.spring.embedded.hsqldb.config;import javax.sql.DataSource;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.jdbc.core.JdbcTemplate;import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;@Configurationpublic class Config { @Bean public DataSource dataSource() { EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder(); EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript("classpath:table.sql") .addScript("classpath:data.sql").build(); return db; } @Bean public JdbcTemplate jdbcTemplate(DataSource dataSource) { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); return jdbcTemplate; }}As I am using in-memory database, so I did not need to configure any database connection details. The default values will be used for connection details.I am using SQL scripts to create a table and storing some sample data. The SQL scripts are kept under src/main/resources folder.table.sqlDROP TABLE CUSTOMER IF EXISTS;CREATE TABLE CUSTOMER ( CUSTOMER_ID integer identity primary key, CUSTOMER_NAME varchar(50) not null, CUSTOMER_ADDRESS varchar(255), CUSTOMER_CITY varchar(50) not null, CUSTOMER_STATE varchar(50) not null, CUSTOMER_ZIP_POSTAL varchar(30) not null);data.sqlINSERT INTO CUSTOMER VALUES(1,'Sumit Ghosh','Garfa','Kolkata','West Bengal','700085')INSERT INTO CUSTOMER VALUES(2,'Gourab Guha','Garia','Kolkata','West Bengal','700145')INSERT INTO CUSTOMER VALUES(3,'Debina Guha','Kestopur','Kolkata','West Bengal','700185')INSERT INTO CUSTOMER VALUES(4,'Debabrata Poddar','Birati','Kolkata','West Bengal','700285')INSERT INTO CUSTOMER VALUES(5,'Amit Dharmale','Thane','Mumbai','Maharastra','400140')Model ClassI have created a model class for mapping Java fields to database table columns.package com.roytuts.spring.embedded.hsqldb.model;public class Customer { private Long customerId; private String customerName; private String customerAddress; private String customerCity; private String customerState; private String customerZip; // getters and setters @Override public String toString() { return "[ Customer Id : " + customerId + ", Customer
2025-04-06MS SQL to MySQL Database Converter is a program to migrate entire or selected database records of MS SQL into MySQL database records. Software provides option to convert views, schemas, stored procedures and Indexes with all necessary attributes. MySQL to MS SQL Database Converter migrates MySQL database records into Microsoft SQL Server database records. Software provide option to convert 4.1 or earlier version of MySQL database. Database utility converts views and indexes with all major attributes. MS Access to MySQL Database Converter converts MS Access database into the MySQL database and save converted database at user specified location. Tool with its advance features is capable to convert MS Access password protected database files. MySQL to MS Access Database Conversion Software converts MySQL database records to MS Access format without writing database queries. Software convert selected or entire database div records with support for all data types, attributes and key constraints. MySQL to MS Excel database converter convert My SQL existing database records into Microsoft Excel Spreadsheet. With an easy to use windows interface, the user just selects database record and click on Convert button to convert entire or selected records to Microsoft excel spreadsheet. MS Excel to MySQL Database Converter Database Converter Software convert data base records created in MS Excel to MySQL server without modifying database integrity. You can easily convert all your database information with support to major version of MSExcel and MySQL server. Excel to Windows Contacts converter software migrate entire contact information from excel file into windows contacts. Software is designed to convert all contact fields including Names, Phone Numbers, Emails, Address etc stored in excel spreadsheets into windows contacts. Oracle to MySQL Database Converter Software converts oracle database records into MySQL database format. Software supports all database attributes, database key constraints, indexes, schemas, null value and primary key constraints. Excel Converter Software is useful to convert excel file from xls to xlsx and xlsx to xls format.Excel Converter Program helps you to convert multiple numbers of XLS files to XLSX and XLSX files to XLS in a batch process in few simple steps. Excel to Phonebook converter software migrate entire contact information from excel file into phonebook. Software is capable to convert all contact fields including names, phone numbers, email address etc stored in excel spreadsheets into phonebook files.
2025-03-26Try out the latest and greatest, Spring Boot can be built and published to your local Maven cache using the Gradle wrapper.You also need JDK 17.$ ./gradlew publishToMavenLocalThis will build all of the jars and documentation and publish them to your local Maven cache.It won’t run any of the tests.If you want to build everything, use the build task:ModulesThere are several modules in Spring Boot. Here is a quick overview:spring-bootThe main library providing features that support the other parts of Spring Boot. These include:The SpringApplication class, providing static convenience methods that can be used to write a stand-alone Spring Application.Its sole job is to create and refresh an appropriate Spring ApplicationContext.Embedded web applications with a choice of container (Tomcat, Jetty, or Undertow).First-class externalized configuration support.Convenience ApplicationContext initializers, including support for sensible logging defaults.spring-boot-autoconfigureSpring Boot can configure large parts of typical applications based on the content of their classpath.A single @EnableAutoConfiguration annotation triggers auto-configuration of the Spring context.Auto-configuration attempts to deduce which beans a user might need. For example, if HSQLDB is on the classpath, and the user has not configured any database connections, then they probably want an in-memory database to be defined.Auto-configuration will always back away as the user starts to define their own beans.spring-boot-startersStarters are a set of convenient dependency descriptors that you can include in your application.You get a one-stop shop for all the Spring and related technology you need without having to hunt through sample code and copy-paste loads of dependency descriptors.For example, if you want to get started using Spring and JPA for database access, include the spring-boot-starter-data-jpa dependency in your project, and you are good to go.spring-boot-actuatorActuator endpoints let you monitor and interact with your application.Spring Boot Actuator provides the infrastructure required for actuator endpoints.It contains annotation support for actuator endpoints.This module provides many
2025-04-13VideoList Plus 5.0.1 DVD inventory database. Store all details of your collection. Customizable.Related keywords: inventory, multimedia, hobby, video, pocket pc, collection, database, dvd, movie, palm, home, pocket, pcMovie Label 2013 13.0.3 The easy way to organize your DVD and movie collection on your PC.Related keywords: movie, dvd, collection, bluray, movie collection, movie database, dvd inventory, dvd collection, tv, divx, dvd manager, movie manager, blu-ray, inventory, collector, video, manager, database, dvd database, vhs, organizer, movie inventoryMy Movie Collection 2.6.1 DVD Catalog Software, track your personal DVD collection automatically!Related keywords: DVD, Movie, List, DVD Inventory, Movie Catalogue, DVD Library, DVD Movies, Movie List, Library, Collector, Movie Collection, DVD Collector, DVD Organizer, DVD Collection, Movie Database, DVD List, Database, Movie Collector, Video Library, DVD Database, DVD Software, DVD Catalog, Collection, Video, Catalogue, Movies, Catalog, Organizer, Inventory, SoftwareMakeMKV 1.12.3 Convert your DVD and Blu-Ray movies to MKV, a format supported by many players.Related keywords: MKV, MKV maker, MKV converter, create MKV, Blu-ray, BD+, maker, create, converterCucusoft DVD to iPod Converter 8.08 Capable converter to encode DVDs to the MP4 or MP3 format for iPods and iPhones.Related keywords: ipod, to, dvd, converter, dvd to ipod converter, dvd to ipod, dvd to mp4, convert dvd to ipod, ipod converter, mp4, convert, videoXilisoft AVI to DVD Converter 6.2.1.0321 Fast and user-friendly AVI to DVD converter with burning and editing features.Related keywords: dvd, to, avi, dvd converter, avi to dvd, avi to dvd converter, burn, convert avi to dvd, burn avi to dvd, burn dvd, converter, convertAcoustica CD/DVD Label Maker 3.33 Create unique layouts for labeling your own CDs/DVDs with Acoustica Label MakerRelated keywords: label, print cd label, make dvd label, jewel case label, cd, create cd label, dvd, dvd cover, CD/DVD, print, case, Label, Acoustica, cover, create, make, jewel, MakerCucusoft iPod Video Converter + DVD to iPod Suite 8.13.8.15 Intuitive & powerful iPod DVD/video converter, supports DivX, MOV, RM, WMV, AVI.Related keywords: iPod, iPod Movie, ipod, convert iPod video, ipod video converter, iPod Movie Converter, to, convert to iPod, iPod Video, Movie, dvd to ipod, convert, video, converter, iPod converter, Video, Converter, dvddvdPean Pro 5.8.5 Fast and
2025-04-03