Commit a1dc916f by 陈科朋

bug修改

parent 4ae90071
...@@ -5,7 +5,6 @@ import org.apache.flume.Event; ...@@ -5,7 +5,6 @@ import org.apache.flume.Event;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.sql.*; import java.sql.*;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
...@@ -77,8 +76,8 @@ public class DAOClass { ...@@ -77,8 +76,8 @@ public class DAOClass {
} }
} }
public void createConnection(String driver, String db_url, String user, String password) throws IOException { public void createConnection(String driver, String db_url, String user, String password) throws SQLException {
if (this.connection == null) { if (this.connection == null || this.connection.isClosed() || this.connection.isValid(1)) {
try { try {
Class.forName(driver); Class.forName(driver);
this.connection = DriverManager.getConnection(db_url, user, password); this.connection = DriverManager.getConnection(db_url, user, password);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment