public class OwDataSourceUtil extends Object
Simple DataSource utility class. Works with JNDI to retrieve DataSource from javax.naming.InitialContext, and "java:comp/env" context.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Constructor and Description |
---|
OwDataSourceUtil() |
Modifier and Type | Method and Description |
---|---|
static org.springframework.jdbc.core.JdbcTemplate |
createJdbcTemplate(DataSource dataSource)
Create a Spring JDBC template for provided DataSource
|
static org.springframework.jdbc.core.JdbcTemplate |
createJdbcTemplateFromId(String jndiName)
Creates an Spring JDBC template instance from provided Id.
|
static DataSource |
retrieveDataSource(String dataSourceName)
Helper method to retrieve DataSource definition by JNDI lookup.
|
public static DataSource retrieveDataSource(String dataSourceName) throws OwDataSourceException
dataSourceName
- OwDataSourceException
public static org.springframework.jdbc.core.JdbcTemplate createJdbcTemplate(DataSource dataSource)
dataSource
- java.sql.DataSourcepublic static org.springframework.jdbc.core.JdbcTemplate createJdbcTemplateFromId(String jndiName) throws OwDataSourceException
jndiName
- String JNDI name to search for DataSource.OwDataSourceException
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.