20260821230656
This commit is contained in:
1 parent
2e5d532f23
commit
c43b4c8364
144 files changed
+7665
-242
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import java.io.FileInputStream;
|
||||
import java.sql.*;
|
||||
import java.util.Properties;
|
||||
public class LogCols {
|
||||
public static void main(String[] args) throws Exception {
|
||||
Properties props = new Properties();
|
||||
try (FileInputStream in = new FileInputStream(args[0])) { props.load(in); }
|
||||
try (Connection conn = DriverManager.getConnection(props.getProperty("url"), props.getProperty("username"), props.getProperty("password"))) {
|
||||
for (String t : new String[]{"s_log_login", "s_log_technical", "s_log_audit"}) {
|
||||
System.out.println("== " + t + " ==");
|
||||
try (Statement st = conn.createStatement(); ResultSet rs = st.executeQuery(
|
||||
"SELECT c.name FROM sys.columns c WHERE c.object_id=OBJECT_ID('" + t + "') ORDER BY c.column_id")) {
|
||||
StringBuilder sb = new StringBuilder(" ");
|
||||
while (rs.next()) sb.append(rs.getString(1)).append(" ");
|
||||
System.out.println(sb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user