21 lines
1.1 KiB
Java
21 lines
1.1 KiB
Java
import java.sql.*;
|
||
public class P5 {
|
||
public static void main(String[] a) throws Exception {
|
||
String url="jdbc:sqlserver://118.89.70.199:1433;databaseName=FMS;encrypt=true;trustServerCertificate=true";
|
||
try (Connection c=DriverManager.getConnection(url,"sa","zhang520..")) {
|
||
System.out.println("--- 配了 summary 的 view schema ---");
|
||
try (Statement s=c.createStatement(); ResultSet r=s.executeQuery(
|
||
"SELECT b_module_id, b_schema_json FROM s_module_schema WHERE b_schema_type='view' AND b_schema_json LIKE '%summary%'")) {
|
||
int n=0;
|
||
while (r.next() && n++<8) System.out.println(r.getString(1)+" => "+r.getString(2));
|
||
if (n==0) System.out.println("(没有任何模块配了 summary)");
|
||
}
|
||
System.out.println("--- 含 type:group 的 view schema 数 ---");
|
||
try (Statement s=c.createStatement(); ResultSet r=s.executeQuery(
|
||
"SELECT COUNT_BIG(1) FROM s_module_schema WHERE b_schema_type='view' AND b_schema_json LIKE '%\"group\"%'")) {
|
||
r.next(); System.out.println(r.getLong(1));
|
||
}
|
||
}
|
||
}
|
||
}
|