Commit a1dc916f by 陈科朋

bug修改

parent 4ae90071
......@@ -5,7 +5,6 @@ import org.apache.flume.Event;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Date;
......@@ -77,8 +76,8 @@ public class DAOClass {
}
}
public void createConnection(String driver, String db_url, String user, String password) throws IOException {
if (this.connection == null) {
public void createConnection(String driver, String db_url, String user, String password) throws SQLException {
if (this.connection == null || this.connection.isClosed() || this.connection.isValid(1)) {
try {
Class.forName(driver);
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