胃肠炎可以吃什么水果| 哇哦什么意思| 口若悬河是什么生肖| 心里烦躁是什么原因| pro是什么氨基酸| 刚出生的小鱼吃什么| 红豆配什么打豆浆好喝| 吃什么补钾最快最好| 后年是什么生肖| 狗咬到什么程度需要打针| 玉米不能和什么食物一起吃| 小月子吃什么水果| 脑供血不足吃什么药效果好| 什么时候说什么话| 血压低压高是什么原因| 喉咙里老是有痰是什么原因| 腹黑什么意思| 后半夜咳嗽是什么原因| 什么什么多彩| 什么东西越吃越饿| 什么是白内障症状| 怀孕十天左右有什么反应| 茶叶有什么功效与作用| 甲减吃什么药| 八仙桌是什么生肖| 喝柠檬水对身体有什么好处| s是什么车| 肺炎支原体抗体阳性是什么意思| 管状腺瘤是什么意思| 牙齿是什么材质| 晚饭吃什么减肥| 颈动脉b超是检查什么| 老干局是干什么的| 藏青色配什么颜色好看| 耳朵尖的人什么命| 香薰是什么| 头晕出汗是什么原因| 女同是什么| 1450是什么意思| 早上五六点是什么时辰| hpv跟tct有什么区别| 惨不忍睹是什么意思| 逆水行舟什么意思| 广西属于什么方向| 化生细胞有是什么意思| dvf是什么品牌| 白脉病西医叫什么病| 护士节送什么鲜花| 蜘蛛的天敌是什么动物| 佬是什么意思| 控告是什么意思| 老头乐是什么| 面基是什么意思啊| 女人做梦哭醒预示什么| 什么水果对心脏有好处| 用什么擦地最干净| 宁字属于五行属什么| 人体由什么组成| 什么人喜欢天天下雨| 煮牛肉放什么容易烂| 女生为什么会痛经| 鬼打墙是什么意思| 肌腱是什么组织| 骨折补钙吃什么钙片好| 6.25是什么日子| 尿道感染有什么现象| 血压偏低是什么原因造成的| 月子能吃什么水果| 二十四节气分别是什么| 酸奶有什么好处| 判缓刑是什么意思| 什么的感受| 过敏看什么科室| 两面派是什么意思| pef是什么意思| 外阴瘙痒用什么药| 月色真美什么意思| 什么闻乐见| 肠炎吃什么药效果最好| 什么是生源地| 什么动物睡觉不闭眼| 心有余悸是什么意思| 牙龈萎缩吃什么药见效快| 喝水都长肉是什么原因| mt指什么| 消化不良吃什么药最好| 吹空调感冒咳嗽吃什么药| 什么叫潮吹| 为什么手术前要禁食禁水| oil什么意思| rice什么意思| 四件套包括什么| 给小孩办身份证需要什么| 开车是什么意思| 缺钾吃什么水果| 传统是什么意思| chest是什么意思| 伤骨头了吃什么好得快| 紫水晶属于五行属什么| 白发越来越多是什么原因造成的| 榴莲和什么相克| n表示什么| 点映什么意思| cos是什么意思啊| 8月15号是什么日子| 甲状腺有什么症状| 部首和偏旁有什么区别| 有心火是什么症状| 水逆是什么意思| 滥竽充数的滥是什么意思| 什么他妈的叫他妈的惊喜| 吃什么降血压| 乩童是什么意思| 呼吸快是什么原因| 昙花是什么意思| 五个月宝宝吃什么辅食最好| 白瓜是什么瓜| 什么是汉服| 养什么能清理鱼缸粪便| 马齿笕有什么功效| 毛孔大什么原因形成的| ecmo是什么| 拉大便肛门口疼痛什么原因| 五十八岁属什么生肖| 小腿经常抽筋是什么原因| 逸搏心律什么意思| 莀字五行属什么| 女人阴唇发黑是什么原因| 什么佛面| 腋下是什么经络| hib疫苗是什么意思| 人参不能和什么一起吃| 兔属什么五行| 尿中泡沫多是什么原因| 灵魂伴侣什么意思| a02是什么牌子| 什么奶粉比较好| 左侧后背疼是什么原因男性| 感冒反复发烧是什么原因引起的| 什么是外阴| 巨蟹座的幸运色是什么颜色| 空心人是什么意思| 小孩反复发烧是什么原因引起的| 拉拉裤和纸尿裤有什么区别| 女孩第一次来月经需要注意什么| 市政协秘书长是什么级别| 梅花手表属于什么档次| 牙周炎吃什么消炎药| 尿酸高会引起什么病| 哎什么意思| 点状强回声是什么意思| 5月28号是什么日子| 南瓜不能和什么食物一起吃| 喝醉是什么感觉| 孩子b型血父母什么血型| 送对象什么礼物好| 1984年属鼠五行属什么| moo是什么意思| 为什么怀孕了就不来月经了| 新百伦鞋子什么档次| 满月是什么时候| 豆芽菜是什么意思| 刚怀孕吃什么对胎儿好| 头皮毛囊炎用什么洗发水| 记忆是什么意思| 超度是什么意思| 维生素b6是治什么的| 这是什么动物| 肛门被捅后有什么影响| 并驾齐驱什么意思| 清远车牌是粤什么| 麸炒是什么意思| 缅怀什么意思| 突然便秘是什么原因引起的| 段泥紫砂壶适合泡什么茶| jeep是什么牌子| 相生什么意思| 恶寒发热是什么意思| 胰腺管扩张是什么原因| 黄金芽是什么茶| 咽拭子是检查什么的| 26度穿什么衣服| 物以类聚什么意思| 博字属于五行属什么| 液氧是什么| 安踏高端品牌叫什么| 荷花代表什么生肖| 金渐层是什么品种| 外阴裂口用什么药| 女人吃秋葵有什么好处| 签证是什么| 大耗是什么意思| 梦见生肉是什么征兆| 流产药叫什么名字| 吃什么促进伤口愈合| 桂林是什么地貌| bottle什么意思| 花胶有什么功效| 血管变窄吃什么能改善| 26度穿什么衣服合适| 黄芪有什么功效| 卵泡回声什么意思| 黄芪是什么样子的| 大腿抽筋是什么原因引起的| 发飙是什么意思| 减肥期间吃什么| 睡觉时身体抽搐是什么原因| 相破是什么意思| 七叶一枝花主治什么病| 2007是什么年| 白羊座和什么座最配| 早上起来后背疼是什么原因| 陕西为什么叫三秦大地| 手术后放疗起什么作用| 木姜子是什么| 胃胀是什么感觉| 菠菜什么季节吃| eur是什么意思| 婴儿放屁臭是什么原因| 过敏是什么症状| 三月初六是什么星座| 2009年是什么生肖年| 脑供血不足吃什么食物| 脑梗复查挂什么科| 什么是针灸| 湿疹长什么样子| urban是什么牌子| 伏羲姓什么| 乙肝抗体阳性是什么意思| 老人双脚浮肿是什么原因| 一什么葡萄| 痔瘘和痔疮有什么区别| ia是什么意思| 着床出血什么时候出现| 记忆力减退吃什么药效果好| 糖尿病能吃什么水果| 牡蛎和生蚝有什么区别| 电泳是什么| 铁蛋白低是什么原因| 什么的大象| 什么什么自如| 什么是人设| 甲硝唑吃多了有什么危害| 学士学位证书有什么用| 安门是什么意思| 升字是什么生肖| 缪斯是什么意思| 积食吃什么药| 办健康证要带什么证件| 份子钱是什么意思| 肾结石是什么原因造成的| 小淋巴结是什么意思| 什么多么什么造句| 但闻人语响的但是什么意思| 写意是什么意思| 试金石什么意思| 男性什么适合长期泡水喝| 冷暴力是什么意思| 把脉能看出什么隐私| 胎盘长什么样子图片| 为什么来月经肚子疼| 12月21日是什么星座| 倾注是什么意思| 什么原因造成耳鸣| 百度
apache > db
Apache DB Project
 
Font size:      

WTCC世界房车赛澳门收官?法国老将穆勒夺车手冠军

Introduction

百度 为继续支持公积金贷款购房,南京公积金管理中心、建委、房产局等五部门昨日联合发布“关于维护住房公积金缴存职工购房贷款权益的实施意见”(以下简称“意见”),总共10项举措中包括要求开发商在领取销许后应在10个工作日内与公积金中心签订公积金贷款按揭协议,以方便缴存职工申请公积金贷款。

As explained in the "Embedded Derby" section, an application can embed Derby, which means that the Derby engine runs in the same JVM as the application.

However, an application can also access a Derby database using the more familiar client/server mode. This is achieved via a framework that embeds Derby and handles database requests from applications, including applications running in different JVMs on the same machine or on remote machines. The Derby Network Server is such a framework. It embeds Derby and manages requests from network clients, as depicted in Figure 2.

Figure 2: Derby Network Server Architecture

Figure 2: Derby Network Server Architecture

This section shows how to start the Derby Network Server, configure your environment to use the Derby Network Client JDBC driver, and compile and run a simple Java application that uses the network server. The information presented here is minimal, just enough to help get new users started. For complete information, see part one of the Derby Server and Administration Guide.

Derby Network Server

First set the DERBY_INSTALL environment variable.

Configure environment

To start or stop the Network Server, set your CLASSPATH to include the jar files listed below:

  • derbynet.jar: contains the code for the Derby Network Server and a reference to the engine jar file (derby.jar)
  • derbytools.jar: contains Derby tools

You can set your CLASSPATH explicitly with the command shown below:

Windows: C:\> set CLASSPATH=%DERBY_INSTALL%\lib\derbytools.jar;%DERBY_INSTALL%\lib\derbynet.jar;.

UNIX: $ export CLASSPATH=$DERBY_INSTALL/lib/derbytools.jar:$DERBY_INSTALL\lib\derbynet.jar:.

You can also use the script that the Derby software distribution provides to set CLASSPATH. Change directory to the DERBY_INSTALL/bin directory, then execute setNetworkServerCP.bat (Windows) or setNetworkServerCP (UNIX), as shown below:

Windows: C:\> cd %DERBY_INSTALL%\bin C:\Apache\db-derby-10.4.1.3-bin\bin> setNetworkServerCP.bat

UNIX: $ cd $DERBY_INSTALL/bin $ . setNetworkServerCP

Start Network Server

Start the Network server by executing the startNetworkServer.bat (Windows) or startNetworkServer (UNIX) script. This will start the Network Server up on port 1527 and echo a startup message:

Windows: C:\Apache\db-derby-10.4.1.3-bin\bin> startNetworkServer.bat Security manager installed using the Basic server security policy. Apache Derby Network Server - 10.4.1.3 - (648739) started and ready to accept connections on port 1527 at 2025-08-06 17:13:13.921 GMT

UNIX: $ startNetworkServer Security manager installed using the Basic server security policy. Apache Derby Network Server - 10.4.1.3 - (648739) started and ready to accept connections on port 1527 at 2025-08-06 09:35:55.871 GMT

Messages will continue to be output to this window as the Network Server processes connection requests.

The Network Server starts Derby, so you'll find the derby.log error log in the directory where you start the Network Server.

An easier way: derbyrun.jar

Furthermore, it is much easier to start Network Server now than before, due to various jar file improvements. With the latest releases, the entire sections "Configure environment" and "Start Network Server" could actually be replaced with just one command line:

Windows: C:\Apache\db-derby-10.4.1.3-bin\lib> java -jar derbyrun.jar server start Security manager installed using the Basic server security policy. Apache Derby Network Server - 10.4.1.3 - (648739) started and ready to accept connections on port 1527 at 2025-08-06 17:13:13.921 GMT

UNIX: $ java -jar derbyrun.jar server start Security manager installed using the Basic server security policy. Apache Derby Network Server - 10.4.1.3 - (648739) started and ready to accept connections on port 1527 at 2025-08-06 09:35:55.871 GMT

Sample Application

Open a new window and set the DERBY_INSTALL environment variable.

Configure environment to use Derby Network Client JDBC driver

To use the Derby Network Client JDBC driver, set your CLASSPATH to include the jar files listed below:

  • derbyclient.jar: contains the JDBC driver
  • derbytools.jar: optional, provides the ij tool

You can set your CLASSPATH explicitly with the command shown below:

Windows: C:\> set CLASSPATH=%DERBY_INSTALL%\lib\derbyclient.jar;%DERBY_INSTALL%\lib\derbytools.jar;.

UNIX: $ export CLASSPATH=$DERBY_INSTALL/lib/derbyclient.jar:$DERBY_INSTALL/lib/derbytools.jar:.

You can also use the script that the Derby software distribution provides to set CLASSPATH. Change directory to the DERBY_INSTALL/bin directory, then execute the setNetworkClientCP.bat (Windows) or setNetworkClientCP (UNIX) script as shown below:

Windows: C:\Apache\db-derby-10.4.1.3-bin\bin> setNetworkClientCP.bat

UNIX: $ . setNetworkClientCP

Test network server connection with ij

An embedded connection URL that creates and connects to a database looks like this:

java org.apache.derby.tools.ij ij> connect 'jdbc:derby:MyDbTest;create=true';

A Derby Network Client connection URL is very close; just add //localhost:1527/ before the database name:

java org.apache.derby.tools.ij ij> connect 'jdbc:derby://localhost:1527/MyDbTest;create=true';

What is the physical location of the newly created database?

If you use the embedded driver, by default the database is created in the same directory in which ij was started up. If you use the Derby Network Client JDBC driver, by default the database is created in the directory where the Network Server was started up; in other words, in DERBY_INSTALL/bin.

Derby provides many ways to specify the actual location. For example, the connection URL below specifies a full path for the database location:

java org.apache.derby.tools.ij ij> connect 'jdbc:derby://localhost:1527//home/bill/DerbyDb/MyDbTest;create=true';

The Developer's Guide provides information about where Derby looks for databases:

Copy sample application

This section uses the same sample application that the "Embedded Derby" section uses.

By default this application runs in embedded mode. If you pass it the derbyclient argument at run time, then it will create and connect to the database using the Derby Network Client JDBC driver instead.

A quick look at the code

The SimpleApp.java application spends most of its time creating a table, inserting data into that table, and selecting the data back, demonstrating many JDBC calls as it does so. This section highlights the JDBC calls that make this specifically a client/server Derby application. The "Embedded Derby" section shows how to turn the same code into an embedded application.

Load the Client JDBC Driver

When executed with the derbyclient argument, the SimpleApp application loads the Derby Network Client driver with this code:

driver = "org.apache.derby.jdbc.ClientDriver"; ... Class.forName(driver).newInstance();

Get a Network Server Connection

When executed with the derbyclient argument, the SimpleApp application creates and connects to the derbyDB database with this code:

protocol = "jdbc:derby://localhost:1527/"; ... conn = DriverManager.getConnection(protocol + "derbyDB;create=true", props);

That connection URL, fully constructed, looks like this:

jdbc:derby://localhost:1527/derbyDB;create=true

Don't shut Derby down

If you look at the SimpleApp.java code you'll notice that it only shuts Derby down if it's running in embedded mode. When connecting via the Network Server, other applications might be accessing the same database you are; so, don't shut down the databases or Derby.

Compile Sample Application

Compile the sample application as shown below:

javac SimpleApp.java

Run Sample Application

Run the sample application like this:

java SimpleApp derbyclient

You should see the output shown below:

SimpleApp starting in derbyclient mode. Loaded the appropriate driver. Connected to and created database derbyDB Created table derbyDB Inserted 1956 Webster Inserted 1910 Union Updated 1956 Webster to 180 Grand Updated 180 Grand to 300 Lakeshore Verified the rows Dropped table derbyDB Closed result set and statement Committed transaction and closed connection SimpleApp finished

Quick question: Where is the physical location of the derbyDB database that the sample application creates?

(Answer: In the default $DERBY_INSTALL/bin location.)

Stop Network Server

Stop the Network server by executing the stopNetworkServer.bat (Windows) or stopNetworkServer (UNIX) script, as shown below:

Windows: C:\> cd %DERBY_INSTALL%\bin C:\Apache\db-derby-10.4.1.3-bin\bin> setNetworkServerCP.bat C:\Apache\db-derby-10.4.1.3-bin\bin> stopNetworkServer.bat

UNIX: $ cd $DERBY_INSTALL/bin $ . setNetworkServerCP $ stopNetworkServer

The window running the NetworkServer should output a message confirming the shutdown.

Note that, as with starting the server, there is also an easier way to shut down the server. For example:

Windows: C:\> java -jar %DERBY_INSTALL%\lib\derbyrun.jar server shutdown

UNIX: $ java -jar $DERBY_INSTALL/lib/derbyrun.jar server shutdown

Run derbyrun.jar without arguments for further usage information. derbyrun.jar has been included with Derby releases since the 10.2 release series.

Next Steps

Network Server Options

By default, the Derby Network Server only accepts requests from the localhost on port 1527. You can modify the Network Server to:

For more information about these options, and more, see the Derby Server and Administration Guide.

Embedded Server

Up until this point, this section has focused on how to start and stop the Network Server as an independent process.

Another option, called the "embedded server", allows an application to load the embedded JDBC driver for its own use and start the Network Server to allow remote access by applications running in other JVMs. The application that does this can access the database with either the embedded driver or the client driver.

Figure 3 depicts an application called MyEmbedSrvApp that loads the embedded driver and also starts up the Network Server. This allows other applications, such as ij or SimpleApp using the Derby Network Client, to connect to the same database via a client JDBC driver.

Figure 3: Derby Embedded Server Architecture

Figure 3: Derby Embedded Server Architecture

While it is certainly possible for MyEmbedSrvApp to use the Derby Network Client JDBC driver, it's probably better for it to use the embedded driver because Derby Network Client JDBC database requests incur the overhead of going out through the network. The embedded server architecture lets the application that embeds Derby retain the advantages of embedded access while also enabling remote access to the same database using another tool, such as ij. Thus, you end up with the best of both worlds: embedded and client/server.

You've reached the end of this Derby tutorial and should now understand how to use Derby in the embedded and Network Server frameworks. The "Overview" section provides suggestions for how you might use Derby with some other products.

 
为什么长鸡眼 1932年属什么 济公搓的泥丸叫什么 公道自在人心是什么意思 结婚9年是什么婚
澳大利亚有什么特产 胸疼是什么原因 九月六号是什么星座 p是什么面料 一泻千里是什么意思
丑未相冲的结果是什么 alba手表是什么牌子 运费险是什么意思 羊水是什么 手指头麻是什么原因引起的
人体7大营养素是什么 利可君片是治什么病 中元节注意什么 为什么积食发烧很难退 附件炎吃什么药最好
什么是感光食物hcv7jop9ns8r.cn 百福骈臻是什么意思hcv8jop2ns8r.cn lpl是什么tiangongnft.com 属猪五行属什么hcv9jop2ns3r.cn 左传是一部什么体史书hcv7jop6ns4r.cn
垂是什么意思hcv9jop6ns0r.cn 北京市副市长是什么级别zsyouku.com 慢什么斯什么weuuu.com 蛇胆是什么hcv9jop5ns6r.cn 多是什么结构的字hcv9jop0ns7r.cn
躁郁症是什么hcv8jop9ns3r.cn 什么叫撤退性出血hcv8jop4ns7r.cn gda是什么血管adwl56.com 月经周期变短是什么原因hcv8jop1ns3r.cn 大阪烧是什么hcv8jop6ns5r.cn
黑曼巴是什么意思hcv8jop3ns2r.cn 缪在姓氏中读什么hcv8jop3ns4r.cn 什么样的充电宝能带上飞机hcv8jop4ns6r.cn 肺不好有什么症状xscnpatent.com 腹部胀痛什么原因hcv8jop0ns7r.cn
百度