六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 216|回复: 0

Derby使用ij工具操作数据库

[复制链接]

升级  15.67%

69

主题

69

主题

69

主题

举人

Rank: 3Rank: 3

积分
247
 楼主| 发表于 2013-1-14 22:59:49 | 显示全部楼层 |阅读模式
解压apache的derby数据库:D:\Program Files\derby\db-derby-10.7.1.1-bin
在home下找到/derby_home/bin/ij工具
启动ij工具
 
ij> connect 'jdbc:derby:ij_cmd_test_db;create=true';WARNING 01J01: Database 'ij_cmd_test_db' not created, connection made to existing database instead.ij(CONNECTION1)>select * from table;ERROR 42X01: Syntax error: Encountered "<EOF>" at line 1, column 19.Issue the 'help' command for general information on IJ command syntax.Any unrecognized commands are treated as potential SQL commands and executed directly.Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.ij(CONNECTION1)> create table ijtest(num int);0 rows inserted/updated/deletedij(CONNECTION1)> select * from ijtest;NUM-----------0 rows selectedij(CONNECTION1)> insert into ijtest values (19890521);1 row inserted/updated/deletedij(CONNECTION1)> insert into ijtest values (19890520);1 row inserted/updated/deletedij(CONNECTION1)> insert into ijtest values (19890519);1 row inserted/updated/deletedij(CONNECTION1)> insert into ijtest values (19890518);1 row inserted/updated/deletedij(CONNECTION1)> select * from ijtest;NUM-----------198905211989052019890519198905184 rows selectedij(CONNECTION1)> 
按照上面步骤,建立数据库"ij_cmd_test_db",建立数据库表"ijtest",最后查询数据库表"select * from ijtest",查询得到刚刚插入的数据.
 
ij工具命令可以通过进入ij命令行后敲入"help"
 
退出 "exit".
 
后面贴上derby的jdbc的访问方式.
 
附件附上一个比较好的derby文档.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表