mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
testcase
This commit is contained in:
@@ -1,44 +1,44 @@
|
||||
package com.alibaba.druid.sql;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.alibaba.druid.util.JdbcUtils;
|
||||
|
||||
public class TestOnlineSQLTest3 extends TestCase {
|
||||
|
||||
private String url = "jdbc:mysql://10.20.144.27/dragoon_v25_masterdb";
|
||||
private String user = "dragoon_test";
|
||||
private String password = "dragoon_test";
|
||||
|
||||
protected Connection conn;
|
||||
|
||||
public void setUp() throws Exception {
|
||||
Class.forName("com.mysql.jdbc.Driver");
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
}
|
||||
|
||||
public void tearDown() throws Exception {
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
conn = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void test_0() throws Exception {
|
||||
// ResultSet rs = conn.getMetaData().getTables(null, null, null, null);
|
||||
// JdbcUtils.printResultSet(rs);
|
||||
|
||||
String sql = "select benchmark( 1, sha1( 'test' ) )";
|
||||
Statement stmt = conn.createStatement();
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
JdbcUtils.printResultSet(rs);
|
||||
|
||||
stmt.close();
|
||||
}
|
||||
}
|
||||
package com.alibaba.druid.sql;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.alibaba.druid.util.JdbcUtils;
|
||||
|
||||
public class TestOnlineSQLTest3 extends TestCase {
|
||||
|
||||
private String url = "jdbc:mysql://10.20.144.27/dragoon_v25_masterdb";
|
||||
private String user = "dragoon_test";
|
||||
private String password = "dragoon_test";
|
||||
|
||||
protected Connection conn;
|
||||
|
||||
public void setUp() throws Exception {
|
||||
Class.forName("com.mysql.jdbc.Driver");
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
}
|
||||
|
||||
public void tearDown() throws Exception {
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
conn = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void test_0() throws Exception {
|
||||
// ResultSet rs = conn.getMetaData().getTables(null, null, null, null);
|
||||
// JdbcUtils.printResultSet(rs);
|
||||
|
||||
String sql = "select benchmark( 1, sha1( 'test' ) )";
|
||||
Statement stmt = conn.createStatement();
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
JdbcUtils.printResultSet(rs);
|
||||
|
||||
stmt.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user