Skip to content

Commit 48c87aa

Browse files
committed
improve
1 parent 2811f37 commit 48c87aa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main/java/com/github/clagomess/modplsql/jdbc/Database.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,21 @@ public static String runPl(String plName, Map<String, String> param) throws SQLE
6868
stmt.executeQuery(sql.toString());
6969

7070
log.info("GET RESULT");
71-
StringBuilder result = new StringBuilder();
72-
while (true){
73-
String buff = getResult();
71+
return getResult();
72+
}
7473

75-
if(buff == null){
76-
break;
77-
}
74+
private static String getResult() throws SQLException {
75+
StringBuilder result = new StringBuilder();
76+
String buff;
7877

78+
while ((buff = getChunkResult()) != null){
7979
result.append(buff);
8080
}
8181

8282
return result.toString();
8383
}
8484

85-
private static String getResult() throws SQLException {
85+
private static String getChunkResult() throws SQLException {
8686
String queryResult = "declare \n" +
8787
" nlns number;\n" +
8888
" buf_t varchar2(32767);\n" +

0 commit comments

Comments
 (0)