本文整理汇总了Java中org.apache.ibatis.datasource.DataSourceFactory.setProperties方法的典型用法代码示例。如果您正苦于以下问题:Java DataSourceFactory.setProperties方法的具体用法?Java DataSourceFactory.setProperties怎么用?Java DataSourceFactory.setProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ibatis.datasource.DataSourceFactory
的用法示例。
在下文中一共展示了DataSourceFactory.setProperties方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dataSourceElement
import org.apache.ibatis.datasource.DataSourceFactory; //导入方法依赖的package包/类
private DataSourceFactory dataSourceElement(XNode context) throws Exception {
if (context != null) {
String type = context.getStringAttribute("type");
Properties props = context.getChildrenAsProperties();
DataSourceFactory factory = (DataSourceFactory) resolveClass(type).newInstance();
factory.setProperties(props);
return factory;
}
throw new BuilderException("Environment declaration requires a DataSourceFactory.");
}
示例2: buildDataSource
import org.apache.ibatis.datasource.DataSourceFactory; //导入方法依赖的package包/类
/**
* @param dataSourceClass {@linkplain DataSource}实现类.
* @param properties
* @return
*/
public static DataSource buildDataSource(String dataSourceClass, Properties properties)
{
try
{
Class<?> clazz = PackageUtil.newClass(dataSourceClass, null);
DataSource dataSource = (DataSource) WPTool.newObject(clazz);
DataSourceFactory factory = new TempFactory(dataSource);
factory.setProperties(properties);
return factory.getDataSource();
} catch (Exception e)
{
throw new DBException(e);
}
}
示例3: dataSourceElement
import org.apache.ibatis.datasource.DataSourceFactory; //导入方法依赖的package包/类
private DataSourceFactory dataSourceElement(XNode context) throws Exception {
if (context != null) {
String type = context.getStringAttribute("type");
Properties props = context.getChildrenAsProperties();
DataSourceFactory factory = (DataSourceFactory) resolveClass(type).newInstance();
factory.setProperties(props);
return factory;
}
throw new BuilderException("Environment declaration requires a DataSourceFactory.");
}
示例4: dataSourceElement
import org.apache.ibatis.datasource.DataSourceFactory; //导入方法依赖的package包/类
private DataSourceFactory dataSourceElement(XNode context) throws Exception {
if (context != null) {
String type = context.getStringAttribute("type");
Properties props = context.getChildrenAsProperties();
DataSourceFactory factory = (DataSourceFactory) resolveClass(type).newInstance();
factory.setProperties(props);
return factory;
}
throw new BuilderException("Environment declaration requires a DataSourceFactory.");
}
示例5: dataSourceElement
import org.apache.ibatis.datasource.DataSourceFactory; //导入方法依赖的package包/类
private DataSourceFactory dataSourceElement(XNode context) throws Exception {
if (context != null) {
String type = context.getStringAttribute("type");
Properties props = context.getChildrenAsProperties();
//根据type="POOLED"解析返回适当的DataSourceFactory
DataSourceFactory factory = (DataSourceFactory) resolveClass(type).newInstance();
factory.setProperties(props);
return factory;
}
throw new BuilderException("Environment declaration requires a DataSourceFactory.");
}