Package org.castor.jdo.conf

Examples of org.castor.jdo.conf.DataSource


    /* Get a (single) connection from this engine. Yes, this needs
       serious re-work. It should be re-written to work with the JDO
       and/or Tyrex pooling mechanism. */
    Connection getConnection() throws DTXException {
        if (_conn == null) {
            DataSource datasource = _database.getDatabaseChoice().getDataSource();
            org.castor.jdo.conf.Driver driver = _database.getDatabaseChoice().getDriver();

            if (datasource != null) {
                throw new DTXException("dtx.DataSourceUnimplemented");
            } else if (driver != null) {
View Full Code Here


     * @param datasource JDBC DataSource class name.
     * @param props Properties to be used for the DataSource.
     * @return JDO Datasource configuration.
     */
    public static DataSource createDataSource(final String datasource, final Properties props) {
        DataSource dsConf = new DataSource();
        dsConf.setClassName(datasource);

        Iterator iter = props.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry entry = (Map.Entry) iter.next();
            String key = (String) entry.getKey();
            String value = (String) entry.getValue();
           
            dsConf.addParam(createParam(key, value));
        }

        return dsConf;
    }
View Full Code Here

TOP

Related Classes of org.castor.jdo.conf.DataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.