Apache Derby为您提供 sysinfo,ij 和 dblook 等工具.
sysinfo工具
使用此工具,您可以获得有关Java和Derby环境的信息.
浏览Derby安装目录的bin文件夹并执行sysinfo命令,如下所示 :
C:\Users\MY_USER>cd %DERBY_HOME%/binC:\Derby\bin>sysinfo
执行时,它会为您提供有关java和derby的系统信息,如下所示 :
------------------ Java Information ------------------Java Version: 1.8.0_101Java Vendor: Oracle CorporationJava home: C:\Program Files\Java\jdk1.8.0_101\jreJava classpath: C:\Users\Tutorialspoint\GoogleDrive\Office\Derby\derby_zip\New folder\db-derby-10.12.1.1-bin\lib;C:\EXAMPLES_\Task\jars\*;C:\EXAMPLES\jars\mysql-connector-java-5.1.40-bin.jar;C:\Users\Tutorialspoint\Google Drive\Office\37.JunitUpdate\jars;C:\Program Files\Apache Software Foundation\Tomcat8.5\lib\*;C:\Derby\lib\derby.jar;C:\Derby\lib\derbyclient.jar;C:\Derby\lib\derbyLocale_cs.jar;C:\Derby\lib\derbyLocale_de_DE.jar;C:\Derby\lib\derbyLocale_es.jar;C:\Derby\lib\derbyLocale_fr.jar;C:\Derby\lib\derbyLocale_hu.jar;C:\Derby\lib\derbyLocale_it.jar;C:\Derby\lib\derbyLocale_ja_JP.jar;C:\Derby\lib\derbyLocale_ko_KR.jar;C:\Derby\lib\derbyLocale_pl.jar;C:\Derby\lib\derbyLocale_pt_BR.jar;C:\Derby\lib\derbyLocale_ru.jar;C:\Derby\lib\derbyLocale_zh_CN.jar;C:\Derby\lib\derbyLocale_zh_TW.jar;C:\Derby\lib\derbynet.jar;C:\Derby\lib\derbyoptionaltools.jar;C:\Derby\lib\derbyrun.jar;C:\Derby\lib\derbytools.jar;;C:\Derby/lib/derby.jar;C:\Derby/lib/derbynet.jar;C:\Derby/lib/derbyclient.jar;C:\Derby/lib/derbytools.jar;C:\Derby/lib/derbyoptionaltools.jarOS name: Windows 10OS architecture: amd64OS version: 10.0Java user name: TutorialspointJava user home: C:\Users\TutorialspointJava user dir: C:\Derby\binjava.specification.name: Java Platform API Specificationjava.specification.version: 1.8java.runtime.version: 1.8.0_101-b13--------- Derby Information --------[C:\Derby\lib\derby.jar] 10.14.2.0 - (1828579)[C:\Derby\lib\derbytools.jar] 10.14.2.0 - (1828579)[C:\Derby\lib\derbynet.jar] 10.14.2.0 - (1828579)[C:\Derby\lib\derbyclient.jar] 10.14.2.0 - (1828579)[C:\Derby\lib\derbyoptionaltools.jar] 10.14.2.0 - (1828579)----------------------------------------------------------------------- Locale Information -----------------Current Locale : [English/United States [en_US]]Found support for locale: [cs] version: 10.14.2.0 - (1828579)Found support for locale: [de_DE] version: 10.14.2.0 - (1828579)Found support for locale: [es] version: 10.14.2.0 - (1828579)Found support for locale: [fr] version: 10.14.2.0 - (1828579)Found support for locale: [hu] version: 10.14.2.0 - (1828579)Found support for locale: [it] version: 10.14.2.0 - (1828579)Found support for locale: [ja_JP] version: 10.14.2.0 - (1828579)Found support for locale: [ko_KR] version: 10.14.2.0 - (1828579)Found support for locale: [pl] version: 10.14.2.0 - (1828579)Found support for locale: [pt_BR] version: 10.14.2.0 - (1828579)Found support for locale: [ru] version: 10.14.2.0 - (1828579)Found support for locale: [zh_CN] version: 10.14.2.0 - (1828579)Found support for locale: [zh_TW] version: 10.14.2.0 - (1828579)------------------------------------------------------------------------------------------------------------
ijtool
使用此工具,您可以运行apache Derby的脚本和查询.
浏览Derby安装目录的bin文件夹并执行ij命令
如下所示 :
C:\Users\MY_USER>cd %DERBY_HOME%/binC:\Derby\bin>ij
这将为您提供 ij shell ,您可以在其中执行derby命令和脚本,如下所示
低于 :
ij version 10.14ij>
使用 help 命令,您可以获得此shell支持的命令列表.
C:\Derby\bin>cd %DERBY_HOME%/binC:\Derby\bin>ijij version 10.14ij> 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 orsynonyms 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 preparedstatement 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 HOLDFORCONNECTION; -- sets holdability for a connection to HOLD -- (i.e. ResultSet.HOLD_CURSORS_OVER_COMMIT) NOHOLDFORCONNECTION; -- sets holdability for a connection to NO HOLD -- (i.e. ResultSet.CLOSE_CURSORS_AT_COMMIT) GET [SCROLL INSENSITIVE] [WITH { HOLD | NOHOLD }] CURSOR name AS 'SQL-Jquery'; -- gets a cursor (JDBC result set) on the query-- the default is a forward-only cursor withholdability NEXT name; -- gets the next row from the named cursor FIRST name; -- gets the first row from the named scrollcursor LAST name; -- gets the last row from the named scrollcursor PREVIOUS name; -- gets the previous row from the named scrollcursor ABSOLUTE integer name; -- positions the named scroll cursor at theabsolute row number -- (A negative number denotes position from thelast row.) RELATIVE integer name; -- positions the named scroll cursor relative tothe current row -- (integer is number of rows) AFTER LAST name; -- positions the named scroll cursor after thelast row BEFORE FIRST name; -- positions the named scroll cursor before thefirst row GETCURRENTROWNUMBER name; -- returns the row number for the currentposition of the named scroll cursor -- (0 is returned when the cursor is notpositioned on a row.) CLOSE name; -- closes the named cursor LOCALIZEDDISPLAY [ ON | OFF ]; -- controls locale sensitive data representation EXIT; -- exits ij HELP; -- shows this messageAny unrecognized commands are treated as potential SQL-J commands and executeddirectly.
dblooktool
此工具用于生成数据定义语言.
浏览Derby安装目录的bin文件夹并执行 dblook 命令,如下所示 :
C:\Users\MY_USER>cd %DERBY_HOME%/binC:\Derby\bin>dblook -d myURL
其中, myURL 是您需要为其生成DDL的数据库的连接URL.