mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
修正运算符优先级别处理不当的问题
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@156 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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;
|
||||
|
||||
public class OnlineSQLTest extends TestCase {
|
||||
private String url = "jdbc:mysql://10.20.129.146/dragoon_v25monitordb_online";
|
||||
private String user = "dragoon";
|
||||
private String password = "dragoon";
|
||||
|
||||
|
||||
|
||||
public void test_list_sql() throws Exception {
|
||||
Connection conn = DriverManager.getConnection(url, user, password);
|
||||
|
||||
int count = 0;
|
||||
String sql = "SELECT id, value FROM m_sql_const";
|
||||
Statement stmt = conn.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
String value = rs.getString(2);
|
||||
System.out.println(value);
|
||||
System.out.println();
|
||||
count++;
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
|
||||
System.out.println("COUNT : " + count);
|
||||
|
||||
conn.close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user