Package org.mortbay.jetty.plus

Examples of org.mortbay.jetty.plus.DefaultDataSourceService


            log.info( "Adding context " + context + " at path " + path );
            container.addWebApp( context, path );
        }

        // Create the DataSource service
        DefaultDataSourceService dss = new DefaultDataSourceService();
        dss.setName( "DataSourceService" );

        // Create the connection pool
        jdbcDataSource cpds = new jdbcDataSource();
        cpds.setDatabase( "jdbc:hsqldb:hsql://localhost/jspwiki" );
        cpds.setLoginTimeout( 10 );
        cpds.setUser( "SA" );
        cpds.setPassword( null );

        // Configure and bind DataSource to JNDI for user database
        dss.addDataSource( "jdbc/UserDatabase", cpds );
        container.server.addService( dss );
        dss.getDataSource( "jdbc/UserDatabase" );
       
        // Configure and bind DataSource to JNDI for group database
        dss.addDataSource( "jdbc/GroupDatabase", cpds );
        container.server.addService( dss );
        dss.getDataSource( "jdbc/GroupDatabase" );
       
        System.out.println( "Configured datasources." );

        // Start the server
        try
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.plus.DefaultDataSourceService

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.