DbDM.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package jnpf.database.source.impl;
  2. import com.baomidou.mybatisplus.annotation.DbType;
  3. import jnpf.database.constant.DbConst;
  4. import jnpf.database.source.DbBase;
  5. import jnpf.database.sql.model.DbStruct;
  6. /**
  7. * 达梦模型
  8. *
  9. * @author JNPF开发平台组 YY
  10. * @version V3.2.0
  11. * @copyright 引迈信息技术有限公司
  12. * @date 2021/10/06
  13. */
  14. public class DbDM extends DbBase {
  15. @Override
  16. protected void init() {
  17. setInstance(
  18. DM,
  19. DbType.DM,
  20. com.alibaba.druid.DbType.dm,
  21. "5236",
  22. "SYSDBA",
  23. "dm",
  24. "dm.jdbc.driver.DmDriver",
  25. "jdbc:dm://{host}:{port}/{schema}");
  26. }
  27. @Override
  28. protected String getConnUrl(String prepareUrl, String host, Integer port, DbStruct struct){
  29. prepareUrl = super.getConnUrl(prepareUrl, host, port, null);
  30. return prepareUrl.replace(DbConst.DB_SCHEMA, struct.getDmDbSchema());
  31. }
  32. // public static void setDmTableModel(DbConnDTO connDTO, List<DbTableModel> tableModelList) {
  33. // //达梦特殊方法
  34. // try {
  35. // @Cleanup Connection dmConn = connDTO.getConn();
  36. // tableModelList.forEach(tm -> {
  37. // try {
  38. // Integer sum = DbDM.getSum(dmConn, tm.getTable());
  39. // tm.setSum(sum);
  40. // } catch (DataException e) {
  41. // e.printStackTrace();
  42. // }
  43. // });
  44. // } catch (Exception e) {
  45. // e.printStackTrace();
  46. // }
  47. // }
  48. //
  49. // private static Integer getSum(Connection connection, String table) throws DataException {
  50. // String sql = "SELECT COUNT(*) as F_SUM FROM " + table;
  51. // return JdbcUtil.queryOneInt(connection, sql, "F_SUM");
  52. // }
  53. }