| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.Statement;
- import java.sql.ResultSet;
- public class TestModelFields {
- public static void main(String[] args) {
- try {
- Class.forName("dm.jdbc.driver.DmDriver");
-
- String url = "jdbc:dm://192.168.0.145:30236?charSet=utf8";
- String username = "WATERSHED";
- String password = "WaterShed./1224";
-
- Connection conn = DriverManager.getConnection(url, username, password);
- Statement stmt = conn.createStatement();
-
- // 查询所有模型的字段情况
- String selectSql = "SELECT model_id, model_name, model_coordinates, rotation_x, rotation_y, rotation_z, scale_x, scale_y, scale_z FROM WATERSHED_MODEL";
- ResultSet rs = stmt.executeQuery(selectSql);
-
- System.out.println("=== 模型数据检查 ===");
- int count = 0;
- while (rs.next()) {
- count++;
- Long modelId = rs.getLong("model_id");
- String modelName = rs.getString("model_name");
- String coordinates = rs.getString("model_coordinates");
-
- System.out.println("\n模型 " + count + ":");
- System.out.println(" ID: " + modelId);
- System.out.println(" 名称: " + modelName);
- System.out.println(" 坐标: " + coordinates);
- System.out.println(" 旋转: X=" + rs.getDouble("rotation_x") + ", Y=" + rs.getDouble("rotation_y") + ", Z=" + rs.getDouble("rotation_z"));
- System.out.println(" 缩放: X=" + rs.getDouble("scale_x") + ", Y=" + rs.getDouble("scale_y") + ", Z=" + rs.getDouble("scale_z"));
- }
-
- System.out.println("\n总共 " + count + " 个模型");
-
- rs.close();
- stmt.close();
- conn.close();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
|