本文整理汇总了Java中org.hsqldb.jdbc.JDBCDriver类的典型用法代码示例。如果您正苦于以下问题:Java JDBCDriver类的具体用法?Java JDBCDriver怎么用?Java JDBCDriver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JDBCDriver类属于org.hsqldb.jdbc包,在下文中一共展示了JDBCDriver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeJiraDataBaseForSla
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Initialize data base with 'MDA' JIRA project.
*/
@BeforeClass
public static void initializeJiraDataBaseForSla() throws SQLException {
final DataSource datasource = new SimpleDriverDataSource(new JDBCDriver(), "jdbc:hsqldb:mem:dataSource", null, null);
final Connection connection = datasource.getConnection();
try {
ScriptUtils.executeSqlScript(connection, new EncodedResource(new ClassPathResource("sql/sla/jira-create.sql"), StandardCharsets.UTF_8));
ScriptUtils.executeSqlScript(connection, new EncodedResource(new ClassPathResource("sql/sla/jira.sql"), StandardCharsets.UTF_8));
} finally {
connection.close();
}
}
示例2: getXAConnection
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Get new XAConnection connection, to be managed by a connection manager.
*/
public XAConnection getXAConnection() throws SQLException {
// Comment out before public release:
/*
System.err.print("Executing " + getClass().getName()
+ ".getXAConnection()...");
*/
// Use JDBCDriver directly so there is no need to register with DriverManager
JDBCConnection connection =
(JDBCConnection) JDBCDriver.getConnection(url, connectionProps);
JDBCXAConnection xaConnection = new JDBCXAConnection(this, connection);
return xaConnection;
}
示例3: crearConexion
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Metodo que establece conexión con la base de datos local
*
* @return objeto conexion
*/
public static Connection crearConexion() {
Connection conexion = null;
try {
DriverManager.registerDriver(new JDBCDriver());
String url = "jdbc:hsqldb:file:./DDBB/data/test";
//Descomentar para probar los test en local.
//String url = "jdbc:hsqldb:hsql://localhost/";
String user = "SA";
String pass = "";
conexion = DriverManager.getConnection(url, user, pass);
} catch (SQLException e) {
e.printStackTrace();
}
return conexion;
}
示例4: getXAConnection
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Get new XAConnection connection, to be managed by a connection manager.
*/
public XAConnection getXAConnection() throws SQLException {
// Comment out before public release:
/*
System.err.print("Executing " + getClass().getName()
+ ".getXAConnection()...");
*/
// Use JDBCDriver directly so there is no need to regiser with DriverManager
JDBCConnection connection =
(JDBCConnection) JDBCDriver.getConnection(url, connectionProps);
JDBCXAConnection xaConnection = new JDBCXAConnection(this, connection);
return xaConnection;
}
示例5: initializeJiraDataBase
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Initialize data base with 'MDA' JIRA project.
*/
@BeforeClass
public static void initializeJiraDataBase() throws SQLException {
datasource = new SimpleDriverDataSource(new JDBCDriver(), "jdbc:hsqldb:mem:dataSource", null, null);
final Connection connection = datasource.getConnection();
final JdbcTemplate jdbcTemplate = new JdbcTemplate(datasource);
try {
ScriptUtils.executeSqlScript(connection,
new EncodedResource(new ClassPathResource("sql/base-1/jira-create.sql"), StandardCharsets.UTF_8));
ScriptUtils.executeSqlScript(connection,
new EncodedResource(new ClassPathResource("sql/base-1/jira.sql"), StandardCharsets.UTF_8));
jdbcTemplate.queryForList("SELECT * FROM pluginversion WHERE ID = 10075");
} finally {
connection.close();
}
}
示例6: initializeJiraDataBaseForImport
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Initialize data base with 'MDA' JIRA project.
*/
@BeforeClass
public static void initializeJiraDataBaseForImport() throws SQLException {
datasource = new SimpleDriverDataSource(new JDBCDriver(), "jdbc:hsqldb:mem:dataSource", null, null);
final Connection connection = datasource.getConnection();
try {
ScriptUtils.executeSqlScript(connection,
new EncodedResource(new ClassPathResource("sql/base-1/jira-create.sql"), StandardCharsets.UTF_8));
ScriptUtils.executeSqlScript(connection,
new EncodedResource(new ClassPathResource("sql/base-2/jira-create.sql"), StandardCharsets.UTF_8));
ScriptUtils.executeSqlScript(connection,
new EncodedResource(new ClassPathResource("sql/upload/jira-create.sql"), StandardCharsets.UTF_8));
ScriptUtils.executeSqlScript(connection, new EncodedResource(new ClassPathResource("sql/base-1/jira.sql"), StandardCharsets.UTF_8));
ScriptUtils.executeSqlScript(connection, new EncodedResource(new ClassPathResource("sql/base-2/jira.sql"), StandardCharsets.UTF_8));
ScriptUtils.executeSqlScript(connection, new EncodedResource(new ClassPathResource("sql/upload/jira.sql"), StandardCharsets.UTF_8));
} finally {
connection.close();
}
}
示例7: setup
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
@Before
public void setup() throws Exception {
Class.forName(JDBCDriver.class.getName());
connection = DriverManager.getConnection(JDBCURI, "SA", "");
connection.setAutoCommit(true);
File f = File.createTempFile(getClass().getSimpleName(), "dir");
f.delete();
f.mkdirs();
dir = f;
StringBuilder configuration = new StringBuilder();
configuration.append("test.driverClass=").append(JDBCDriver.class.getName()).append("\n");
configuration.append("test.jdbcUri=").append(JDBCURI).append("\n");
configuration.append("test.username=SA\n");
configuration.append("test.password=\n");
configuration.append("test.patchDirs=").append(dir.getAbsolutePath()).append("/\n");
PropertiesConfigurationParser configurationParser = new PropertiesConfigurationParser();
ByteArrayInputStream in = null;
try {
in = new ByteArrayInputStream(configuration.toString().getBytes());
Collection<ConfigurationEntry> configurationEntries = configurationParser.parse(new File("."), in);
configurationEntry = configurationEntries.iterator().next();
configurationEntry.validate();
} finally {
IOUtils.closeQuietly(in);
}
}
示例8: executeApp
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
@Override
public void executeApp() throws Exception {
if (connection == null) {
connection = JDBCDriver.getConnection("jdbc:hsqldb:mem:test", null);
Statement statement = connection.createStatement();
try {
statement.execute("create table employee (name varchar(100))");
statement.execute("insert into employee (name) values ('john doe')");
statement.execute("insert into employee (name) values ('jane doe')");
statement.execute("insert into employee (name) values ('sally doe')");
} finally {
statement.close();
}
}
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/jdbcservlet");
MockHttpServletResponse response = new MockHttpServletResponse();
service((ServletRequest) request, (ServletResponse) response);
}
示例9: configureMetaStore
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
protected void configureMetaStore(HiveConf conf) {
String jdbcDriver = JDBCDriver.class.getName();
try {
Class.forName(jdbcDriver);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
// Set the hsqldb driver
metaStorageUrl = "jdbc:hsqldb:mem:" + UUID.randomUUID().toString();
hiveConf.set("datanucleus.connectiondrivername", jdbcDriver);
hiveConf.set("javax.jdo.option.ConnectionDriverName", jdbcDriver);
// No pooling needed. This will save us a lot of threads
hiveConf.set("datanucleus.connectionPoolingType", "None");
conf.setBoolVar(METASTORE_VALIDATE_CONSTRAINTS, true);
conf.setBoolVar(METASTORE_VALIDATE_COLUMNS, true);
conf.setBoolVar(METASTORE_VALIDATE_TABLES, true);
}
示例10: cleanJiraDataBaseForSla
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Clean data base with 'MDA' JIRA project.
*/
@AfterClass
public static void cleanJiraDataBaseForSla() throws SQLException {
final DataSource datasource = new SimpleDriverDataSource(new JDBCDriver(), "jdbc:hsqldb:mem:dataSource", null, null);
final Connection connection = datasource.getConnection();
try {
ScriptUtils.executeSqlScript(connection, new EncodedResource(new ClassPathResource("sql/sla/jira-drop.sql"), StandardCharsets.UTF_8));
} finally {
connection.close();
}
}
示例11: initializeJiraDataBaseForImport
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Initialize data base with 'MDA' JIRA project.
*/
@BeforeClass
public static void initializeJiraDataBaseForImport() throws SQLException {
final DataSource datasource = new SimpleDriverDataSource(new JDBCDriver(), "jdbc:hsqldb:mem:dataSource", null, null);
final Connection connection = datasource.getConnection();
try {
ScriptUtils.executeSqlScript(connection,
new EncodedResource(new ClassPathResource("sql/upload/jira-create.sql"), StandardCharsets.UTF_8));
ScriptUtils.executeSqlScript(connection, new EncodedResource(new ClassPathResource("sql/upload/jira.sql"), StandardCharsets.UTF_8));
} finally {
connection.close();
}
}
示例12: cleanJiraDataBaseForImport
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Clean data base with 'MDA' JIRA project.
*/
@AfterClass
public static void cleanJiraDataBaseForImport() throws SQLException {
final DataSource datasource = new SimpleDriverDataSource(new JDBCDriver(), "jdbc:hsqldb:mem:dataSource", null, null);
final Connection connection = datasource.getConnection();
try {
ScriptUtils.executeSqlScript(connection, new EncodedResource(new ClassPathResource("sql/upload/jira-drop.sql"), StandardCharsets.UTF_8));
} finally {
connection.close();
}
}
示例13: HSQLHibernateEntryDatabase
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
HSQLHibernateEntryDatabase(File dataDir) {
if (factory == null) {
factory = new HibernateBuilder().confDriver(JDBCDriver.class).confDialect(HSQLDialect.class)
.confConnection("jdbc:hsqldb:" + new File(dataDir, "hsqlEntryDB").getAbsolutePath())
.buildServiceRegistry().build();
}
s = factory.openSession();
createTable();
}
示例14: getXAConnection
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
/**
* Get new XAConnection connection, to be managed by a connection manager.
*/
public XAConnection getXAConnection() throws SQLException {
// Comment out before public release:
/*
System.err.print("Executing " + getClass().getName()
+ ".getXAConnection()...");
*/
// Use JDBCDriver directly so there is no need to regiser with DriverManager
JDBCConnection connection = (JDBCConnection) JDBCDriver.getConnection(url, connectionProps);
JDBCXAConnection xaConnection = new JDBCXAConnection(this, connection);
return xaConnection;
}
示例15: releaseInternalConnection
import org.hsqldb.jdbc.JDBCDriver; //导入依赖的package包/类
void releaseInternalConnection() {
if (sessionContext.depth == 0) {
JDBCDriver.driverInstance.threadConnection.set(null);
}
}