MCPcopy Index your code
hub / github.com/epcdiy/timemachineplus / init

Method init

src/main/java/MySQLHelper.java:43–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 }
42
43 public boolean init()
44 {
45 if(url==null)
46 {
47 try {
48 initCfg();
49 } catch (Exception e) {
50 StringWriter sw = new StringWriter();
51 PrintWriter pw = new PrintWriter(sw);
52 e.printStackTrace(pw);
53 logger.error(e.toString());
54 return false;
55 }
56 }
57 try
58 {
59 Class.forName(name);// 指定连接类型
60 conn = DriverManager.getConnection(url, user, password);// 获取连接
61 logger.info("mysql connected!");
62 return true;
63 } catch (Exception e)
64 {
65 StringWriter sw = new StringWriter();
66 PrintWriter pw = new PrintWriter(sw);
67 e.printStackTrace(pw);
68 logger.error(e.toString());
69 }
70 return false;
71 }
72
73 /**
74 *

Callers 4

MySQLHelperMethod · 0.95
exeSqlMethod · 0.95
importSqlMethod · 0.95
querySqlMethod · 0.95

Calls 1

initCfgMethod · 0.95

Tested by

no test coverage detected