@@ -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+ }
0 commit comments