mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
adapter代码整理优化
This commit is contained in:
@@ -92,17 +92,16 @@ public class DBTest {
|
||||
|
||||
private String clob2Str(Clob clob) {
|
||||
String content = "";
|
||||
try {
|
||||
Reader is = clob.getCharacterStream();
|
||||
BufferedReader buff = new BufferedReader(is);
|
||||
try (Reader is = clob.getCharacterStream(); BufferedReader buff = new BufferedReader(is)) {
|
||||
String line = buff.readLine();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (line != null) {
|
||||
sb.append(line);
|
||||
line = buff.readLine();
|
||||
}
|
||||
content = sb.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public class TestConstant {
|
||||
public final static String jdbcUser = "root";
|
||||
public final static String jdbcPassword = "121212";
|
||||
|
||||
public static DruidDataSource dataSource;
|
||||
public final static DruidDataSource dataSource;
|
||||
|
||||
static {
|
||||
dataSource = new DruidDataSource();
|
||||
|
||||
Reference in New Issue
Block a user