Java Code Examples for org.mybatis.generator.config.JDBCConnectionConfiguration#setDriverClass()
The following examples show how to use
org.mybatis.generator.config.JDBCConnectionConfiguration#setDriverClass() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MyBatisGeneratorConfigurationParser.java From mapper-generator-javafx with Apache License 2.0 | 5 votes |
protected void parseJdbcConnection(Context context, Node node) { JDBCConnectionConfiguration jdbcConnectionConfiguration = new JDBCConnectionConfiguration(); context.setJdbcConnectionConfiguration(jdbcConnectionConfiguration); Properties attributes = parseAttributes(node); String driverClass = attributes.getProperty("driverClass"); String connectionURL = attributes.getProperty("connectionURL"); jdbcConnectionConfiguration.setDriverClass(driverClass); jdbcConnectionConfiguration.setConnectionURL(connectionURL); String userId = attributes.getProperty("userId"); if (stringHasValue(userId)) { jdbcConnectionConfiguration.setUserId(userId); } String password = attributes.getProperty("password"); if (stringHasValue(password)) { jdbcConnectionConfiguration.setPassword(password); } NodeList nodeList = node.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node childNode = nodeList.item(i); if (childNode.getNodeType() != Node.ELEMENT_NODE) { continue; } if ("property".equals(childNode.getNodeName())) { parseProperty(jdbcConnectionConfiguration, childNode); } } }
Example 2
Source File: IbatorConfigurationParser.java From mybatis-generator-core-fix with Apache License 2.0 | 5 votes |
private void parseJdbcConnection(Context context, Node node) { JDBCConnectionConfiguration jdbcConnectionConfiguration = new JDBCConnectionConfiguration(); context.setJdbcConnectionConfiguration(jdbcConnectionConfiguration); Properties attributes = parseAttributes(node); String driverClass = attributes.getProperty("driverClass"); //$NON-NLS-1$ String connectionURL = attributes.getProperty("connectionURL"); //$NON-NLS-1$ String userId = attributes.getProperty("userId"); //$NON-NLS-1$ String password = attributes.getProperty("password"); //$NON-NLS-1$ jdbcConnectionConfiguration.setDriverClass(driverClass); jdbcConnectionConfiguration.setConnectionURL(connectionURL); if (stringHasValue(userId)) { jdbcConnectionConfiguration.setUserId(userId); } if (stringHasValue(password)) { jdbcConnectionConfiguration.setPassword(password); } NodeList nodeList = node.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node childNode = nodeList.item(i); if (childNode.getNodeType() != Node.ELEMENT_NODE) { continue; } if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$ parseProperty(jdbcConnectionConfiguration, childNode); } } }
Example 3
Source File: MyBatisGeneratorConfigurationParser.java From mybatis-generator-core-fix with Apache License 2.0 | 5 votes |
private void parseJdbcConnection(Context context, Node node) { JDBCConnectionConfiguration jdbcConnectionConfiguration = new JDBCConnectionConfiguration(); context.setJdbcConnectionConfiguration(jdbcConnectionConfiguration); Properties attributes = parseAttributes(node); String driverClass = attributes.getProperty("driverClass"); //$NON-NLS-1$ String connectionURL = attributes.getProperty("connectionURL"); //$NON-NLS-1$ String userId = attributes.getProperty("userId"); //$NON-NLS-1$ String password = attributes.getProperty("password"); //$NON-NLS-1$ jdbcConnectionConfiguration.setDriverClass(driverClass); jdbcConnectionConfiguration.setConnectionURL(connectionURL); if (stringHasValue(userId)) { jdbcConnectionConfiguration.setUserId(userId); } if (stringHasValue(password)) { jdbcConnectionConfiguration.setPassword(password); } NodeList nodeList = node.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node childNode = nodeList.item(i); if (childNode.getNodeType() != Node.ELEMENT_NODE) { continue; } if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$ parseProperty(jdbcConnectionConfiguration, childNode); } } }
Example 4
Source File: IbatorConfigurationParser.java From mybatis-generator-plus with Apache License 2.0 | 5 votes |
private void parseJdbcConnection(Context context, Node node) { JDBCConnectionConfiguration jdbcConnectionConfiguration = new JDBCConnectionConfiguration(); context.setJdbcConnectionConfiguration(jdbcConnectionConfiguration); Properties attributes = parseAttributes(node); String driverClass = attributes.getProperty("driverClass"); //$NON-NLS-1$ String connectionURL = attributes.getProperty("connectionURL"); //$NON-NLS-1$ String userId = attributes.getProperty("userId"); //$NON-NLS-1$ String password = attributes.getProperty("password"); //$NON-NLS-1$ jdbcConnectionConfiguration.setDriverClass(driverClass); jdbcConnectionConfiguration.setConnectionURL(connectionURL); if (stringHasValue(userId)) { jdbcConnectionConfiguration.setUserId(userId); } if (stringHasValue(password)) { jdbcConnectionConfiguration.setPassword(password); } NodeList nodeList = node.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node childNode = nodeList.item(i); if (childNode.getNodeType() != Node.ELEMENT_NODE) { continue; } if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$ parseProperty(jdbcConnectionConfiguration, childNode); } } }
Example 5
Source File: MyBatisGeneratorConfigurationParser.java From mybatis-generator-plus with Apache License 2.0 | 5 votes |
private void parseJdbcConnection(Context context, Node node) { JDBCConnectionConfiguration jdbcConnectionConfiguration = new JDBCConnectionConfiguration(); context.setJdbcConnectionConfiguration(jdbcConnectionConfiguration); Properties attributes = parseAttributes(node); String driverClass = attributes.getProperty("driverClass"); //$NON-NLS-1$ String connectionURL = attributes.getProperty("connectionURL"); //$NON-NLS-1$ String userId = attributes.getProperty("userId"); //$NON-NLS-1$ String password = attributes.getProperty("password"); //$NON-NLS-1$ jdbcConnectionConfiguration.setDriverClass(driverClass); jdbcConnectionConfiguration.setConnectionURL(connectionURL); if (stringHasValue(userId)) { jdbcConnectionConfiguration.setUserId(userId); } if (stringHasValue(password)) { jdbcConnectionConfiguration.setPassword(password); } NodeList nodeList = node.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node childNode = nodeList.item(i); if (childNode.getNodeType() != Node.ELEMENT_NODE) { continue; } if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$ parseProperty(jdbcConnectionConfiguration, childNode); } } }