设为首页
优惠IDC
收藏本站
六狼博客
六狼论坛
开启辅助访问
切换到窄版
用户名
Email
自动登录
找回密码
密码
登录
立即注册
只需一步,快速开始
只需一步,快速开始
快捷导航
门户
首页
BBS
云计算
大数据
手机
移动开发android,ios,windows phone,windows mobile
编程
编程技术java,php,python,delphi,ruby,c,c++
前端
WEB前端htmlcss,javascript,jquery,html5
数据库
数据库开发Access,mysql,oracle,sql server,MongoDB
系统
操作系统windows,linux,unix,os,RedHat,tomcat
架构
项目管理
软件设计,架构设计,面向对象,设计模式,项目管理
企业
服务
运维实战
神马
搜索
搜索
热搜:
php
java
python
ruby
hadoop
sphinx
solr
ios
android
windows
centos
本版
帖子
用户
六狼论坛
»
首页
›
数据库开发
›
HSQLDB
›
HSQL实战使用手册.
返回列表
查看:
202
|
回复:
0
HSQL实战使用手册.
[复制链接]
liukai
liukai
当前离线
积分
105
窥视卡
雷达卡
升级
36.67%
当前用户组为
秀才
当前积分为
105
, 升到下一级还需要 95 点。
27
主题
27
主题
27
主题
秀才
秀才, 积分 105, 距离下一级还需 95 积分
秀才, 积分 105, 距离下一级还需 95 积分
积分
105
发消息
楼主
|
发表于 2013-1-14 23:42:37
|
显示全部楼层
|
阅读模式
不讲原理.只讲如何使用HSQL.
<dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>2.0.0</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version> <type>jar</type> <scope>compile</scope> </dependency>
添加hsql 的jar包和链接包.
hsql的连接配置文件.
spring.properties
# database propertiesapp.jdbc.driverClassName=org.hsqldb.jdbcDriverapp.jdbc.url=jdbc:hsqldb:hsql://localhostapp.jdbc.username=saapp.jdbc.password=
jdbc配置.
jdbc-context.xml
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.0.xsd "><context:property-placeholder location="/WEB-INF/spring.properties" /> <!-- Enable annotation style of managing transactions --><tx:annotation-driven transaction-manager="transactionManager" /> <!-- Declare a datasource that has pooling capabilities--> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"destroy-method="close"p:driverClass="${app.jdbc.driverClassName}"p:jdbcUrl="${app.jdbc.url}"p:user="${app.jdbc.username}"p:password="${app.jdbc.password}"p:acquireIncrement="5"p:idleConnectionTestPeriod="60"p:maxPoolSize="100"p:maxStatements="50"p:minPoolSize="10" /><!-- Declare a transaction manager --><bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" p:dataSource-ref="dataSource" /> </beans>
下面就是重点了,即如何启动HSQL,并添加数据.
启动服务器后,找到hsqldb-**.jar 右键点击 run as - java application
如下图.
首先启动hsql服务器.
接着我们就可以在控制台看到hsql启动成功.
然后准备打开GUI界面,选择下面的服务.
出现图形配置界面后,选择图中的 Server 类型.
还有其它很多种类型,想知道各个的区别,自己google下就是了.这不讲理论,只讲使用.
点击OK.
然后就是在图中创建表之类的操作了.
OVER!
GOOD LUCK!
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
千斤顶
显身卡
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
Copyright © 2008-2020
六狼论坛
(https://it.6wolf.com) 版权所有 All Rights Reserved.
Powered by
Discuz!
X3.4
京ICP备14020293号-2
本网站内容均收集于互联网,如有问题请联系
QQ:389897944
予以删除
快速回复
返回顶部
返回列表