All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xdev.db.hsql2.jdbc.HSQL2JDBCDataSource Maven / Gradle / Ivy

The newest version!
/*
 * SqlEngine Database Adapter HSQL2 - XAPI SqlEngine Database Adapter for HSQL2
 * Copyright © 2003 XDEV Software (https://xdev.software)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see .
 */
package xdev.db.hsql2.jdbc;

import xdev.db.DBException;
import xdev.db.jdbc.JDBCDataSource;


public class HSQL2JDBCDataSource extends JDBCDataSource
{
	public HSQL2JDBCDataSource()
	{
		super(new HSQL2Dbms());
	}
	
	@Override
	public Parameter[] getDefaultParameters()
	{
		return new Parameter[]{
			HOST.clone(),
			PORT.clone(9001),
			USERNAME.clone("sa"),
			PASSWORD.clone(),
			CATALOG.clone(),
			URL_EXTENSION.clone(),
			IS_SERVER_DATASOURCE.clone(),
			SERVER_URL.clone(),
			AUTH_KEY.clone()
		};
	}
	
	@Override
	protected HSQL2ConnectionInformation getConnectionInformation()
	{
		return new HSQL2ConnectionInformation(
			getHost(),
			getPort(),
			getUserName(),
			getPassword().getPlainText(),
			getCatalog(),
			getUrlExtension(),
			getDbmsAdaptor());
	}
	
	@Override
	public HSQL2JDBCConnection openConnectionImpl() throws DBException
	{
		return new HSQL2JDBCConnection(this);
	}
	
	@Override
	public HSQL2JDBCMetaData getMetaData() throws DBException
	{
		return new HSQL2JDBCMetaData(this);
	}
	
	@Override
	public boolean canExport()
	{
		return true;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy