Skip to content

Commit ed56ede

Browse files
author
mayur.patel
committed
Fixed formatting and spelling mistakes
1 parent cbacfee commit ed56ede

2 files changed

Lines changed: 30 additions & 30 deletions

File tree

‎spring-boot-h2/spring-boot-h2-database/src/main/java/com/baeldung/h2db/demo/SpringBootApp.java‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public static void main(String[] args) {
2525
@PostConstruct
2626
private void initDb() {
2727
System.out.println(String.format(
28-
"****** Creating table: %s, and Inserting test data ******", "Employees"));
28+
"****** Creating table: %s, and Inserting test data ******", "Employees"));
2929

3030
String sqlStatements[] = {
31-
"drop table employees if exists",
32-
"create table employees(id serial,first_name varchar(255),last_name varchar(255))",
33-
"insert into employees(first_name, last_name) values('Eugen','Paraschiv')",
34-
"insert into employees(first_name, last_name) values('Scott','Tiger')"
31+
"drop table employees if exists",
32+
"create table employees(id serial,first_name varchar(255),last_name varchar(255))",
33+
"insert into employees(first_name, last_name) values('Eugen','Paraschiv')",
34+
"insert into employees(first_name, last_name) values('Scott','Tiger')"
3535
};
3636

3737
Arrays.asList(sqlStatements).stream().forEach(sql -> {
@@ -41,20 +41,20 @@ private void initDb() {
4141

4242
System.out.println(String.format("****** Fetching from table: %s ******", "Employees"));
4343
jdbcTemplate.query("select id,first_name,last_name from employees",
44-
new RowMapper<Object>() {
45-
@Override
46-
public Object mapRow(ResultSet rs, int i) throws SQLException {
47-
System.out.println(String.format("id:%s,first_name:%s,last_name:%s",
48-
rs.getString("id"),
49-
rs.getString("first_name"),
50-
rs.getString("last_name")));
51-
return null;
52-
}
53-
});
44+
new RowMapper<Object>() {
45+
@Override
46+
public Object mapRow(ResultSet rs, int i) throws SQLException {
47+
System.out.println(String.format("id:%s,first_name:%s,last_name:%s",
48+
rs.getString("id"),
49+
rs.getString("first_name"),
50+
rs.getString("last_name")));
51+
return null;
52+
}
53+
});
5454
}
5555

5656
@Bean(initMethod = "start", destroyMethod = "stop")
57-
public Server inMemoryH2DatabaseaServer() throws SQLException {
57+
public Server inMemoryH2DatabaseServer() throws SQLException {
5858
return Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", "9091");
5959
}
60-
}
60+
}

‎spring-boot-h2/spring-boot-h2-remote-app/src/main/java/com/baeldung/h2db/demo/ClientSpringBootApp.java‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public static void main(String[] args) {
2424
private void initDb() {
2525
System.out.println("****** Inserting more sample data in the table: Employees ******");
2626
String sqlStatements[] = {
27-
"insert into employees(first_name, last_name) values('Donald','Trump')",
28-
"insert into employees(first_name, last_name) values('Barack','Obama')"
27+
"insert into employees(first_name, last_name) values('Donald','Trump')",
28+
"insert into employees(first_name, last_name) values('Barack','Obama')"
2929
};
3030

3131
Arrays.asList(sqlStatements).stream().forEach(sql -> {
@@ -35,15 +35,15 @@ private void initDb() {
3535

3636
System.out.println(String.format("****** Fetching from table: %s ******", "Employees"));
3737
jdbcTemplate.query("select id,first_name,last_name from employees",
38-
new RowMapper<Object>() {
39-
@Override
40-
public Object mapRow(ResultSet rs, int i) throws SQLException {
41-
System.out.println(String.format("id:%s,first_name:%s,last_name:%s",
42-
rs.getString("id"),
43-
rs.getString("first_name"),
44-
rs.getString("last_name")));
45-
return null;
46-
}
47-
});
38+
new RowMapper<Object>() {
39+
@Override
40+
public Object mapRow(ResultSet rs, int i) throws SQLException {
41+
System.out.println(String.format("id:%s,first_name:%s,last_name:%s",
42+
rs.getString("id"),
43+
rs.getString("first_name"),
44+
rs.getString("last_name")));
45+
return null;
46+
}
47+
});
4848
}
49-
}
49+
}

0 commit comments

Comments
 (0)