org.mybatis.generator.config.JDBCConnectionConfiguration.getProperties()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.mybatis.generator.config.JDBCConnectionConfiguration.getProperties()方法的一些代码示例,展示了JDBCConnectionConfiguration.getProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JDBCConnectionConfiguration.getProperties()方法的具体详情如下:
包路径:org.mybatis.generator.config.JDBCConnectionConfiguration
类名称:JDBCConnectionConfiguration
方法名:getProperties

JDBCConnectionConfiguration.getProperties介绍

暂无

代码示例

代码示例来源:origin: roncoo/roncoo-mybatis-generator

public Connection getConnection(JDBCConnectionConfiguration config)
    throws SQLException {
  Driver driver = getDriver(config);
  Properties props = new Properties();
  if (stringHasValue(config.getUserId())) {
    props.setProperty("user", config.getUserId()); //$NON-NLS-1$
  }
  if (stringHasValue(config.getPassword())) {
    props.setProperty("password", config.getPassword()); //$NON-NLS-1$
  }
  props.putAll(config.getProperties());
  Connection conn = driver.connect(config.getConnectionURL(), props);
  if (conn == null) {
    throw new SQLException(getString("RuntimeError.7")); //$NON-NLS-1$
  }
  return conn;
}

代码示例来源:origin: handosme/mybatis-generator-plus

public Connection getConnection(JDBCConnectionConfiguration config)
    throws SQLException {
  Driver driver = getDriver(config);
  Properties props = new Properties();
  if (stringHasValue(config.getUserId())) {
    props.setProperty("user", config.getUserId()); //$NON-NLS-1$
  }
  if (stringHasValue(config.getPassword())) {
    props.setProperty("password", config.getPassword()); //$NON-NLS-1$
  }
  props.putAll(config.getProperties());
  Connection conn = driver.connect(config.getConnectionURL(), props);
  if (conn == null) {
    throw new SQLException(getString("RuntimeError.7")); //$NON-NLS-1$
  }
  return conn;
}

代码示例来源:origin: cxjava/mybatis-generator-core

public Connection getConnection(JDBCConnectionConfiguration config) throws SQLException {
  Driver driver = getDriver(config);
  Properties props = new Properties();
  if (stringHasValue(config.getUserId())) {
    props.setProperty("user", config.getUserId()); //$NON-NLS-1$
  }
  if (stringHasValue(config.getPassword())) {
    props.setProperty("password", config.getPassword()); //$NON-NLS-1$
  }
  if (stringHasValue(config.getRemarksReporting())) {
    props.setProperty("remarksReporting", config.getRemarksReporting()); //$NON-NLS-1$
  } else {
    props.setProperty("remarksReporting", "true"); //$NON-NLS-1$
  }
  props.putAll(config.getProperties());
  Connection conn = driver.connect(config.getConnectionURL(), props);
  if (conn == null) {
    throw new SQLException(getString("RuntimeError.7")); //$NON-NLS-1$
  }
  return conn;
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

/**
 * This constructor is called when there is a JDBCConnectionConfiguration
 * specified in the configuration.
 * 
 * @param config the configuration
 */
public JDBCConnectionFactory(JDBCConnectionConfiguration config) {
  super();
  userId = config.getUserId();
  password = config.getPassword();
  connectionURL = config.getConnectionURL();
  driverClass = config.getDriverClass();
  otherProperties = config.getProperties();
}

相关文章