close cache instances properly (#2630)
* Evaluation article: Different Types of Bean Injection in Spring * added tests & changed configuration to Java-based config * removed xml config files * rename unit tests * BAEL-972 - Apache Commons Text * remove code from evaluation article * remove code from evaluation article * BAEL-972 - Apache Commons Text - added another example * BAEL-972 - Apache Commons Text - just indentation * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java * BAEL-994 - TemporalAdjuster in Java - fix problems * BAEL-1033 Introduction to StreamUtils * BAEL-1033 Introduction to StreamUtils * BAEL-1033 Introduction to StreamUtils * fix formatting * BAEL-1033 minor refactor * BAEL-1035 Introduction to Eclipse Collections * format * BAEL-1035 Introduction to Eclipse Collections * BAEL-1035 Introduction to Eclipse Collections * BAEL-1035 Introduction to Eclipse Collections * cleanup * cleanup * BAEL-1109 Introduction to JCache * BAEL-1109 Introduction to JCache * remove unneeded property in pom.xml * fix formatting * close cache instances properly * remove latest commit * BAEL-1057 Introduction to rxjava-jdbc
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
f5c539f8ba
commit
68d807e0c4
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.rxjava.jdbc;
|
||||
|
||||
public class Connector {
|
||||
|
||||
public static final String DB_CONNECTION = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1";
|
||||
public static final String DB_USER = "";
|
||||
public static final String DB_PASSWORD = "";
|
||||
}
|
||||
13
rxjava/src/main/java/com/baeldung/rxjava/jdbc/Employee.java
Normal file
13
rxjava/src/main/java/com/baeldung/rxjava/jdbc/Employee.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.baeldung.rxjava.jdbc;
|
||||
|
||||
import com.github.davidmoten.rx.jdbc.annotations.Column;
|
||||
|
||||
public interface Employee {
|
||||
|
||||
@Column("id")
|
||||
int id();
|
||||
|
||||
@Column("name")
|
||||
String name();
|
||||
|
||||
}
|
||||
29
rxjava/src/main/java/com/baeldung/rxjava/jdbc/Manager.java
Normal file
29
rxjava/src/main/java/com/baeldung/rxjava/jdbc/Manager.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.baeldung.rxjava.jdbc;
|
||||
|
||||
public class Manager {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
public Manager(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
16
rxjava/src/main/java/com/baeldung/rxjava/jdbc/Utils.java
Normal file
16
rxjava/src/main/java/com/baeldung/rxjava/jdbc/Utils.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.baeldung.rxjava.jdbc;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
public class Utils {
|
||||
|
||||
public static String getStringFromInputStream(InputStream input) throws IOException {
|
||||
StringWriter writer = new StringWriter();
|
||||
IOUtils.copy(input, writer, "UTF-8");
|
||||
return writer.toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user