在Eclipse下,从安装到使用Derby插件
本文参考资料:
http://www.cecs.csulb.edu/~monge/classes/share/usingEclipseDerby.html
http://www.ibm.com/developerworks/opensource/library/os-ad-eclipse/
http://db.apache.org/derby/integrate/plugin_howto.html
http://db.apache.org/derby/papers/DerbyTut/ij_intro.html
安装Derby Plugin到Eclipse:
首先从Derby下载页面 查找最新官方发布的版本(或者需要的版本),下载derby_core_plugin
和 derby_ui_plugin这两个必须的Eclipse插件下载到计算,并解压缩到Eclipse目录下的plugins文 件夹下。注意,压缩包中所有文件可能都默认在plugin文件夹下,所以解压缩後,將得到plugin文件夹(也可能会叫plugin(1))下的所有文 件拷贝到eclipse安装目录下的plugin文件夹中。
被拷贝的文件应该是org.apache.derby.core_10.6.2
, org.apache.derby.ui_1.1.2
, 和 org.apache.derby.plugin.doc_1.1.2这样3个名称的(根据下载选择,版本好会有不同)。
使用Derby同Eclipse:
首 先,添加DerbyJava项目。运行Eclipse(如果Eclipse在安装Derby前就开着,请重新启动Eclipse)。在Package Explorer中选择Java项目,右键,依次选择Apache Derby,Add Apache Derby nature.到此,添加Derby完成。
你可以再次在项目上点击右键,Apache Derby,选择sysInfo(Derby System Information),便能在Eclipse的控制台输出中看到Derby系统信息。如下:
Java Version: 1.6.0_18
Java Vendor: Sun Microsystems Inc.
Java home: /usr/local/jdk1.6.0_18/jre
Java classpath: /windows/E/Computer Study/Software Study/Programming/Eclipse Workspace On Ubuntu 10.10/AccountManagement/bin:/opt/eclipse/plugins/org.apache.derby.core_10.6.2/derbytools.jar:/opt/eclipse/plugins/org.apache.derby.core_10.6.2/derby.jar:/opt/eclipse/plugins/org.apache.derby.core_10.6.2/derbynet.jar:/opt/eclipse/plugins/org.apache.derby.core_10.6.2/derbyclient.jar
OS name: Linux
OS architecture: i386
OS version: 2.6.35-22-generic
Java user name: knowyourself1010
Java user home: /home/knowyourself1010
Java user dir: /windows/E/Computer Study/Software Study/Programming/Eclipse Workspace On Ubuntu 10.10/AccountManagement
java.specification.name: Java Platform API Specification
java.specification.version: 1.6
java.runtime.version: 1.6.0_18-b07
--------- Derby Information --------
JRE - JDBC: Java SE 6 - JDBC 4.0
[/opt/eclipse/plugins/org.apache.derby.core_10.6.2/derby.jar] 10.6.2.1 - (999685)
[/opt/eclipse/plugins/org.apache.derby.core_10.6.2/derbytools.jar] 10.6.2.1 - (999685)
[/opt/eclipse/plugins/org.apache.derby.core_10.6.2/derbynet.jar] 10.6.2.1 - (999685)
[/opt/eclipse/plugins/org.apache.derby.core_10.6.2/derbyclient.jar] 10.6.2.1 - (999685)
------------------------------------------------------
----------------- Locale Information -----------------
------------------------------------------------------
ij>
首先,按照http://db.apache.org/derby/papers/DerbyTut/ij_intro.html#ij_create 创建一个数据库命令如下:
如果执行成功,刷新PackageExplorer中的项目目录,便能看到一个名为MyDbTest的文件夹和一个derby.log文件。可以打开derby.log文件瞧瞧。
在ij中输入help;可以查看帮助:
Supported commands include:
PROTOCOL 'JDBC protocol' [ AS ident ];
-- sets a default or named protocol
DRIVER 'class for driver'; -- loads the named class
CONNECT 'url for database' [ PROTOCOL namedProtocol ] [ AS connectionName ];
-- connects to database URL
-- and may assign identifier
SET CONNECTION connectionName; -- switches to the specified connection
SHOW CONNECTIONS; -- lists all connections
AUTOCOMMIT [ ON | OFF ]; -- sets autocommit mode for the connection
DISCONNECT [ CURRENT | connectionName | ALL ];
-- drop current, named, or all connections;
-- the default is CURRENT
SHOW SCHEMAS; -- lists all schemas in the current database
SHOW [ TABLES | VIEWS | PROCEDURES | FUNCTIONS | SYNONYMS ] { IN schema };
-- lists tables, views, procedures, functions or synonyms
SHOW INDEXES { IN schema | FROM table };
-- lists indexes in a schema, or for a table
SHOW ROLES; -- lists all defined roles in the database,
-- sorted
SHOW ENABLED_ROLES; -- lists the enabled roles for the current
-- connection (to see current role use
-- VALUES CURRENT_ROLE), sorted
SHOW SETTABLE_ROLES; -- lists the roles which can be set for the
-- current connection, sorted
DESCRIBE name; -- lists columns in the named table
COMMIT; -- commits the current transaction
ROLLBACK; -- rolls back the current transaction
PREPARE name AS 'SQL-J text'; -- prepares the SQL-J text
EXECUTE { name | 'SQL-J text' } [ USING { name | 'SQL-J text' } ] ;
-- executes the statement with parameter
-- values from the USING result set row
REMOVE name; -- removes the named previously prepared statement
RUN 'filename'; -- run commands from the named file
ELAPSEDTIME [ ON | OFF ]; -- sets elapsed time mode for ij
MAXIMUMDISPLAYWIDTH integerValue;
-- sets the maximum display width for
-- each column to integerValue
ASYNC name 'SQL-J text'; -- run the command in another thread
WAIT FOR name; -- wait for result of ASYNC'd command
GET [SCROLL INSENSITIVE] [WITH {HOLD | NOHOLD}] CURSOR name AS 'SQL-J query';
-- gets a cursor (JDBC result set) on the query
-- the default is a forward-only cursor with holdability
NEXT name; -- gets the next row from the named cursor
FIRST name; -- gets the first row from the named scroll cursor
LAST name; -- gets the last row from the named scroll cursor
PREVIOUS name; -- gets the previous row from the named scroll cursor
ABSOLUTE integer name; -- positions the named scroll cursor at the absolute row number
-- (A negative number denotes position from the last row.)
RELATIVE integer name; -- positions the named scroll cursor relative to the current row
-- (integer is number of rows)
AFTER LAST name; -- positions the named scroll cursor after the last row
BEFORE FIRST name; -- positions the named scroll cursor before the first row
GETCURRENTROWNUMBER name; -- returns the row number for the current position of the named scroll cursor
-- (0 is returned when the cursor is not positioned on a row.)
CLOSE name; -- closes the named cursor
LOCALIZEDDISPLAY [ ON | OFF ];
-- controls locale sensitive data representation
EXIT; -- exits ij
HELP; -- shows this message
Any unrecognized commands are treated as potential SQL-J commands and executed directly.
输入show connections;可以看到当前链接,如下:
CONNECTION0* - jdbc:derby:MyDbTest
* = current connection
接在来根据ij介绍,在当前数据库(MyDbTest)中创建表derbyDB,并增加修改数据,控制台输入输出如下:
0 rows inserted/updated/deleted
ij> insert into derbyDB values (1956,'Webster St.');
1 row inserted/updated/deleted
ij> insert into derbyDB values (1910,'Union St.');
1 row inserted/updated/deleted
ij> select * from derbyDB;
NUM |ADDR
----------------------------------------------------
1956 |Webster St.
1910 |Union St.
2 rows selected
ij> update derbyDB set num=180,addr='Grand Ave.' where num=1956;
1 row inserted/updated/deleted
ij> select * from derbyDB;
NUM |ADDR
----------------------------------------------------
180 |Grand Ave.
1910 |Union St.
2 rows selected
ij> show connections;
No connections available.
ij> exit;
在程序中链接MyDbTest数据库的命令有:
Connection conn =DriverManager.getConnection("jdbc:derby:MyDbTest");
或者:
jdbc:derby:../otherDirectory/MyDbTest
jdbc:derby:directory:MyDbTest
jdbc:derby:jar:(c:/derby/lib/jar2.jar)MyDbTest
更多链接方式请见:http://db.apache.org/derby/docs/dev/devguide/cdevdvlp34964.html
2023年12月11日 23:47
I booked 러시아마사지 during my business trip, and it was the best decision ever.
2023年12月13日 04:42
백링크하이's commitment to quality is unmatched. They're a game-changer in the SEO industry.
2023年12月14日 23:29
Whether you're playing 바카라 in a lavish casino or at home with friends, the game never fails to deliver an unforgettable experience.
2023年12月15日 00:00
We’re a gaggle of volunteers and starting a brand new scheme in our community. Your site provided us with useful info to work on. You’ve done a formidable process and our entire neighborhood might be thankful to you. 스포츠중계
2023年12月19日 21:47
thank for dropping this story. I am definitely tired of struggling to find relevant and intelligent commentary on this subject. Everyone nowadays seem to go to extremes to either drive home their viewpoint or suggest that everybody else in the globe is wrong. thank for your concise and relevant insight. Excellent article. The writing style which you have used in this article is very good and it made the article of better quality. Thank you so much for this informative post.
2023年12月23日 21:13
Join 해외스포츠중계 for a front-row seat to sports' grand stage.
2023年12月24日 13:48
I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article.
2023年12月24日 13:53
Wow! This could be one particular of the most beneficial blogs We’ve ever arrive across on this subject. Actually Great. I’m also a specialist in this topic therefore I can understand your hard work.
2023年12月24日 14:33
Nice to visit your blog again. Several months have passed. This is the article I have been waiting for for a long time. I need this article to complete my assignment in college and it has the same topic as your article. thank you
2023年12月24日 14:57
I have read your article; it is very informative and helpful for me. I admire the valuable information you offer in your articles. Thanks for posting it
2023年12月24日 15:02
you should make the laying zone as level as possible make a ton of pressing factor when the pool is on an incline. Also, this pressing factor can, over the long haul, truly negatively affect the underlying honesty of the pool.
2023年12月24日 15:18
Great information! I recently discovered your blog and have been reading along. I thought I would leave my first comment. I don't know what to say other than what I have.
2023年12月24日 15:20
I am constantly surprised by the amount of information accessible on this subject. What you presented was well researched and well written to get your stand on this over to all your readers. Thanks a lot my dear
2023年12月24日 15:43
"Thank you for your efforts to share your knowledge. The topics I found here were really effective for a topic I have been researching for a long time.
2023年12月24日 15:52
This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info
2023年12月24日 16:04
You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this.
2023年12月24日 16:28
That is the excellent mindset, nonetheless is just not help to make every sence whatsoever preaching about that mather. Virtually any method many thanks in addition to i had endeavor to promote your own article in to delicius nevertheless it is apparently a dilemma using your information sites can you please recheck the idea. thanks once more
2023年12月24日 16:34
Useful post. This is my first time I visit here. I found so many intriguing stuff with regards to your blog particularly its conversation. Actually its incredible article. Keep it up.
2023年12月24日 16:59
I will right away take hold of your rss feed as I can not to find your email subscription link or newsletter service. Do you have any? Please permit me know in order that I may just subscribe. Thanks.
2023年12月24日 17:02
I will right away take hold of your rss feed as I can not to find your email subscription link or newsletter service. Do you have any? Please permit me know in order that I may just subscribe. Thanks.
2023年12月24日 17:06
Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts
2023年12月24日 17:23
The details you supply in your write-ups. Maintain sharing of this type info. I truly value your operate in this article. Below we are examining simply exactly how to the setup hp printer. You can resolve those concerns with the assistance of
2023年12月24日 17:30
They can be tips related to numerous composition categories, including college applications and complex assignments like Kaplan assignment help
2023年12月24日 17:44
Standard sessions allow me to share the simplest way to thanks a lot for ones hard work, which in turn is the reason why I am just traveling to the web page every day, seeking brand-new, exciting information. A lot of, cheers!
2023年12月24日 17:55
I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work
2023年12月24日 18:46
I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work
2023年12月24日 18:54
Wow! This could be one particular of the most beneficial blogs We’ve ever arrive across on this subject. Actually Great. I’m also a specialist in this topic therefore I can understand your hard work.
2023年12月24日 19:03
It is a good site post without fail. Not too many people would actually, the way you just did. I am impressed that there is so much information about this subject that has been uncovered and you’ve defeated yourself this time, with so much quality. Good Works!
2023年12月24日 19:19
Acknowledges for paper such a beneficial composition, I stumbled beside your blog besides decipher a limited announce. I want your technique of inscription.
2023年12月24日 19:23
Nice to visit your blog again. Several months have passed. This is the article I have been waiting for for a long time. I need this article to complete my assignment in college and it has the same topic as your article. thank you
2023年12月24日 19:30
Tipobet, the leading brand in the market, aims to increase your money seven times with its 25% Instant Loss Bonus. You can immediately access the game producer to take advantage of free spins. The 20% Unconditional Bonus is the largest
2023年12月24日 19:58
Tipobet, the leading brand in the market, aims to increase your money seven times with its 25% Instant Loss Bonus. You can immediately access the game producer to take advantage of free spins. The 20% Unconditional Bonus is the largest
2023年12月24日 20:05
Useful post. This is my first time I visit here. I found so many intriguing stuff with regards to your blog particularly its conversation. Actually its incredible article. Keep it up.
2023年12月24日 20:20
you should make the laying zone as level as possible make a ton of pressing factor when the pool is on an incline. Also, this pressing factor can, over the long haul, truly negatively affect the underlying honesty of the pool.
2023年12月24日 20:20
This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info
2023年12月24日 20:36
Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up
2023年12月24日 20:40
Useful post. This is my first time I visit here. I found so many intriguing stuff with regards to your blog particularly its conversation. Actually its incredible article. Keep it up.
2023年12月24日 20:51
Thank you so much for providing good quality information. I think it would not have been easy to collect this information and organize it in an easy to understand way
2023年12月24日 20:55
Hello, I am one of the most impressed people in your article. sòng bạc I'm very curious about how you write such a good article. Are you an expert on this subject? and good toto site info for you
2023年12月24日 21:06
Standard sessions allow me to share the simplest way to thanks a lot for ones hard work, which in turn is the reason why I am just traveling to the web page every day, seeking brand-new, exciting information. A lot of, cheers!
2023年12月24日 21:15
I have read your excellent post. This is a great job. I have enjoyed reading your post first time. I want to say thanks for this post. Thank you...
2023年12月26日 22:04
There is noticeably big money to comprehend this. I assume you have made certain nice points in features also. 에볼루션카지노
2023年12月27日 04:37
The ability to participate in virtual book tours and online events is a key advantage of self-publishing. self publishing on amazon
2023年12月28日 22:43
Booking ahead at 창원휴게텔 is wise; it ensures you get your preferred time slot.
2023年12月29日 18:40
티비위키 is a must-visit for anyone seeking quality OTT content.
2023年12月30日 15:08
There is clearly a lot to know about this. I think you made various good points in features also. Divine Revelations
2024年1月21日 14:19
I can’t believe focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material without a doubt. It is one of the greatest contents
2024年1月21日 16:47
I am scanning for and I need to post a comment that "The substance of your post is grand" Great work
2024年1月21日 17:41
I really loved reading your blog. It was very well authored and easy to understand
2024年1月21日 18:09
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business
2024年1月21日 18:30
This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post. I will visit your blog regularly for Some latest post
2024年1月21日 19:19
You are really a very high talented singer!!! I really love your music
2024年1月21日 19:58
i'm glad to find this publish Very beneficial for me, because it contains lot of statistics
2024年1月21日 20:19
Acknowledges for paper such a beneficial composition, I stumbled beside your blog besides decipher a limited announce. I want your technique of inscription.
2024年1月21日 21:03
Thank you for the auspicious writeup. It in fact was an amusement account it. Look advanced to far added agreeable from you! By the way, how could we communicate
2024年1月22日 13:45
I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us
2024年1月22日 14:26
Major thankies for the post.Really thank you! Really Great.
2024年1月22日 14:55
This is my first time i visit here and I found so many interesting stuff in your blog especially it's discussion, thank you
2024年1月22日 15:28
Someone Sometimes with visits your blog regularly and recommended it in my experience to read as well. The way of writing is excellent and also the content is top-notch. Thanks for that insight you provide the readers
2024年1月22日 16:10
"It’s going to be end of mine day, however before
finish I am reading this fantastic paragraph to increase my knowledge."
2024年1月24日 16:25
Your article has piqued a lot of positive interest. I can see why since you have done such a good job of making it interesting
2024年1月24日 18:05
Professional gutter cleaning company in London with over 10 years experience. We provide residential and commercial gutter cleaning, unblocking downpipes, gutter repair and soffit and fascia cleaning throughout Greater London
2024年1月26日 16:03
바카라사이트 바카라사이트 우리카지노 카지노는 바카라, 블랙잭, 룰렛 및 슬롯 등 다양한 게임을 즐기실 수 있는 공간입니다. 게임에서 승리하면 큰 환호와 함께 많은 당첨금을 받을 수 있고, 패배하면 아쉬움과 실망을 느끼게 됩니다.
2024年1月26日 16:15
하노이 꼭 가봐야 할 베스트 업소 추천 안내 및 예약, 하노이 밤문화 에 대해서 정리해 드립니다. 하노이 가라오케, 하노이 마사지, 하노이 풍선바, 하노이 밤문화를 제대로 즐기시기 바랍니다. 하노이 밤문화 베스트 업소 요약 베스트 업소 추천 및 정리.
2024年1月29日 15:26
No.1 먹튀검증 사이트, 먹튀사이트, 검증사이트, 토토사이트, 안전사이트, 메이저사이트, 안전놀이터 정보를 제공하고 있습니다. 먹튀해방으로 여러분들의 자산을 지켜 드리겠습니다. 먹튀검증 전문 커뮤니티 먹튀클린만 믿으세요!!
2024年1月29日 15:38
베트남 남성전용 커뮤니티❣️ 베트남 하이에나 에서 베트남 밤문화를 추천하여 드립니다. 베트남 가라오케, 베트남 VIP마사지, 베트남 이발관, 베트남 황제투어 남자라면 꼭 한번은 경험 해 봐야할 화끈한 밤문화로 모시겠습니다.
2024年1月31日 19:24
나는 당신의 블로그를 읽었고 그것은 나에게 매우 도움이됩니다. 감사합니다. 향후 업데이트를 위해 사이트를 북마크했습니다.
2024年1月31日 19:44
당신은 여기에 정말 좋은 게시물입니다. 시간을내어 소중한 정보를 게시 해 주셔서 감사합니다. 양질의 콘텐츠는 항상 방문자를 끌어들이는 것입니다.
2024年1月31日 20:02
나는 당신의 블로그를 읽었고 그것은 나에게 매우 도움이됩니다. 감사합니다. 향후 업데이트를 위해 사이트를 북마크했습니다.
2024年1月31日 20:16
배포 한 모든 지식에 다시 한 번 감사드립니다. 나는 그 기사에 매우 관심이 있었고, 인정해야 할 매우 고무적이었습니다. 나는 항상 이와 같은 흥미로운 기사를 접하기 때문에 당신의 사이트를 방문하는 것을 좋아합니다. 훌륭합니다, 대단히 감사합니다. 계속 공유하십시오! 문안 인사
2024年1月31日 20:37
나는 당신의 블로그를 읽었고 그것은 나에게 매우 도움이됩니다. 감사합니다. 향후 업데이트를 위해 사이트를 북마크했습니다.
2024年1月31日 20:57
배포 한 모든 지식에 다시 한 번 감사드립니다. 나는 그 기사에 매우 관심이 있었고, 인정해야 할 매우 고무적이었습니다. 나는 항상 이와 같은 흥미로운 기사를 접하기 때문에 당신의 사이트를 방문하는 것을 좋아합니다. 훌륭합니다, 대단히 감사합니다. 계속 공유하십시오! 문안 인사
2024年1月31日 21:10
당신은 여기에 정말 좋은 게시물입니다. 시간을내어 소중한 정보를 게시 해 주셔서 감사합니다. 양질의 콘텐츠는 항상 방문자를 끌어들이는 것입니다.
2024年1月31日 21:24
나는 당신의 블로그를 읽었고 그것은 나에게 매우 도움이됩니다. 감사합니다. 향후 업데이트를 위해 사이트를 북마크했습니다.
2024年1月31日 21:35
다른 모든 유익한 사이트에 감사드립니다. 다른 곳에서는 그런 이상적인 수단으로 작성된 그런 종류의 정보를 얻을 수 있을까요? 지금 막 운영중인 벤처 기업이 있으며 그러한 정보를 찾고있었습니다.
2024年4月24日 15:40
블록체인개발 코인지갑개발 IT컨설팅 메스브레인팀이 항상 당신을 도울 준비가 되어 있습니다. 우리는 마음으로 가치를 창조한다는 철학을 바탕으로 일하며, 들인 노력과 시간에 부흥하는 가치만을 받습니다. 고객이 만족하지 않으면 기꺼이 환불해 드립니다.
https://xn--539awa204jj6kpxc0yl.kr/
2024年4月30日 19:00
irritable bowel is really bad, this disease can really crap your digestive system~ 먹튀검증
2024年6月03日 17:35
The tech-original mission is to help you better understand technology, and make better decisions in the fields of IT, Tech, and Crypto.
https://www.tech-original.com/
2024年6月08日 12:26
The tech-original mission is to help you better understand technology, and make better decisions in the fields of IT, Tech, and Crypto.
https://www.tech-original.com/