javadb_java打包 - CSDN
  • javaDB简单使用笔记

    千次阅读 2013-02-02 17:15:14
    Javadb学习环境变量设置:DERBY_HOME=D:\ProgramFiles\Environment\javadbpath=.;%JAVA_HOME%/bin;%path%;%CATALINA_HOME%/bin;%ANT_HOME%/bin;%ANT_HOME%/bin;C:\Program Files\IDM Computer Solutions\UltraEdit\;%...




    path=.;%JAVA_HOME%/bin;%path%;%CATALINA_HOME%/bin;%ANT_HOME%/bin;%ANT_HOME%/bin;C:\Program Files\IDM Computer Solutions\UltraEdit\;%JAVA_HOME%\jre\lib;%DERBY_HOME%\bin





    java -jar %derby_home%\lib\derbyrun.jar server start


    java -jar %derby_home%\lib\derbyrun.jar server shutdown




    ij> exit;  退出


    Email server :




    Creating a Derby database and running SQL statementsNow, you will use the Derby ij tool to load the Derby database engine. You will use theDerby embedded driver to create and connect to the firstdb database. You will alsouse a few basic SQL statements to create and populate a table.1. Run the Derby ij tool.If you included the DERBY_HOME/bin directory in your PATH environment variable,type:ijOtherwise, you can use the java command to start the ij tool.OperatingSystemCommandUNIX(Korn Shell)java -jar $DERBY_HOME/lib/derbyrun.jar ijij version 10.5Windows java -jar %DERBY_HOME%\lib\derbyrun.jar ijij version 10.52. Create the database and open a connection to the database using the embeddeddriver.CONNECT 'jdbc:derby:firstdb;create=true';Description of connection command:connectThe ij command to establish a connection to a database. The Derbyconnection URL is enclosed in single quotation marks. An ij command canbe in either uppercase or lowercase.jdbc:derby:The JDBC protocol specification for the Derby driver.firstdbThe name of the database. The name can be any string. Because nofilepath is specified, the database is created in the default working directory(DERBYTUTOR).;create=trueThe Derby URL attribute that is used to create a database. Derby does nothave an SQL create database command.;Getting Started with Java DB23The semicolon is the ij command terminator.3. Create a table with two columns using standard SQL.CREATE TABLE FIRSTTABLE(ID INT PRIMARY KEY,NAME VARCHAR(12));0 rows inserted/updated/deleted4. Insert three records.INSERT INTO FIRSTTABLE VALUES(10,'TEN'),(20,'TWENTY'),(30,'THIRTY');3 rows inserted/updated/deleted5. Perform a simple select of all records in the table.SELECT * FROM FIRSTTABLE;ID |NAME------------------------10 |TEN20 |TWENTY30 |THIRTY3 rows selected6. Perform a qualified select of the record with column ID=20.SELECT * FROM FIRSTTABLEWHERE ID=20;ID |NAME------------------------20 |TWENTY1 row selected7. Optional: Create and populate additional tables and other schema objects.a. Load the SQL script 'ToursDB_schema.sql';ij> ...CREATE TABLE AIRLINES(AIRLINE CHAR(2) NOT NULL ,AIRLINE_FULL VARCHAR(24),BASIC_RATE DOUBLE PRECISION,...0 rows inserted/updated/deleted... Other output messages not shown ...b. Populate the tables with data by running the script 'loadTables.sql';ij> run 'loadCOUNTRIES.sql';ij> insert into COUNTRIES values ( 'Afghanistan','AF','Asia');1 row inserted/updated/deletedij> insert into COUNTRIES values ( 'Albania','AL','Europe');1 row inserted/updated/deleted... Other output messages not shown ...8. Exit the ij tool.exit;You should be returned to the DERBYTUTOR directory.9. Browse the most


    Activity 2: Run SQL using the client driver

    java -jar %DERBY_HOME%\lib\derbyrun.jar server start


    java -jar %DERBY_HOME%\lib\derbyrun.jar ij

    CONNECT 'jdbc:derby://localhost:1527/seconddb;create=true';

    备注区别:CONNECT 'jdbc:derby:firstdb;create=true'; 


    CREATE TABLE SECONDTABLE(ID INT PRIMARY KEY,NAME VARCHAR(14));0 rows inserted/updated/deleted



    INSERT INTO SECONDTABLE VALUES(100,'ONE HUNDRED'),(200,'TWO HUNDRED'),(300,'THREE HUNDRED');3 rows inserted/updated/deleted


    SELECT * FROM SECONDTABLE;ID |NAME------------------------100 |ONE HUNDRED200 |TWO HUNDRED300 |THREE HUNDRED3 rows selected


    Exit ij.


    java -jar %DERBY_HOME%\lib\derbyrun.jar servershutdown

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.Statement;
    import  org.apache.derby.jdbc.EmbeddedDriver;
    public class JavaDBTest {
        public static void main(String[] args) throws Exception {
            String driver = "org.apache.derby.jdbc.EmbeddedDriver";
            String url = "jdbc:derby:";
            String facetDir = "aaa";
            Connection connection = DriverManager.getConnection(url + facetDir+ ";create=true");
            Statement stmt = connection.createStatement();
            String creatSql="CREATE TABLE  testDB (" + "facetId INTEGER PRIMARY KEY," + " name VARCHAR(256))";
            stmt.executeUpdate("INSERT INTO testDB(facetId, name) " + "VALUES(1, '123')");
            stmt.executeUpdate("INSERT INTO testDB(facetId, name) " + "VALUES(2, '123')");
            stmt.executeUpdate("INSERT INTO testDB(facetId, name) " + "VALUES(3, '123')");
             System.out.println(stmt.executeQuery("select * from testDB").toString());

  • javaDB数据源的配置

    2016-08-24 10:51:28

    <?xml version="1.0" encoding="UTF-8"?>
    <persistence xmlns=""

    <persistence-unit name="users">
    <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect" />
    <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver" />
    <property name="hibernate.connection.url" value="jdbc:derby:F:\YcApp\javaDB\test;create=true;user=test;password=test" />
    <property name="hibernate.connection.password" value="test"></property>
    <property name="hibernate.connection.username" value="test"></property>
    <property name="hibernate.default_schema" value="test"></property>
    <property name="" value="create" />
    <property name="hibernate.show_sql" value="true" />
    <property name="hibernate.format_sql" value="true"/>
    <property name="hibernate.hbm2ddl.import_files" value="/sql/populate.sql"/>

  • JAVADB的研究一

    2011-04-17 17:54:00
    javaDb开发的DB种类繁多,可以大致划分为三类: 1、面向对象化直接存储的db 2、实现k/v存储的db 3、面向关系数据库的db。   今天主要讲解第三个db 目前在java目前流行的关系...







    目前在java目前流行的关系数据库java-db,主要是三种  derby、 hsql 和 h2。

    h2 和 hsql有很大的相似性,应为其有一个共同的创建者。




    三者都是100% java db,同时支持 内存、文件 和 网络三种操作方式。

    三者的数据存储方式,h2 和 hsql单文件存储,derby为多文件存储

    三者对100万数据存储,实现速度(文件操作) hsql > h2 >> derby


    h2 为开源组织,没有太商业化的组织支持;




    derby 开源,已经纳入java sdk 内置。


    本人看好 h2,开发势头良好。


  • JavaDb入门(1)

    2009-02-13 13:47:55
    java"] package org.hank; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; public class JavaDBDemo { static Connection conn; public static v.....

    package org.hank;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.Statement;

    public class JavaDBDemo {
    static Connection conn;

    public static void main(String[] args) {
    String driver = "org.apache.derby.jdbc.EmbeddedDriver";
    String connectionURL = "jdbc:derby:myDatabase;create=true";
    String createString = "CREATE TABLE Employee (NAME VARCHAR(32) NOT NULL, ADDRESS VARCHAR(50) NOT NULL)";
    // String dropTableStr = "Drop table CONTACTS";
    try {
    } catch (java.lang.ClassNotFoundException e) {
    try {
    conn = DriverManager.getConnection(connectionURL);
    // 执行创建数据库
    Statement stmt = conn.createStatement();
    // 新增表记录
    // PreparedStatement psInsert = conn.prepareStatement("insert into Employee values (?,?)");
    // psInsert.setString(1, "hank");
    // psInsert.setString(2, "123");
    // // 查询表记录
    // Statement stmt2 = conn.createStatement();
    // ResultSet rs = stmt2.executeQuery("select * from Employee");
    // int num = 0;
    // while ( {
    // System.out.println(++num + ": Name: " + rs.getString(1)
    // + "\n Address:" + rs.getString(2));
    // }
    // // 删除表记录
    // PreparedStatement del = conn.prepareStatement("Delete from Employee");
    // del.executeUpdate();

    // rs.close();
    } catch (Exception e) {
  • javaDB笔记

    2020-05-24 23:34:12
    NULL 博文链接:
  • 使用 Java DB (Derby) 数据库

    千次阅读 2018-02-23 21:38:15
    使用 Java DB (Derby) 数据库本文档说明了如何在 NetBeans IDE 中设置与 Java DB 数据库的连接。在建立连接之后,即可开始在 IDE 中使用该数据库,您可以执行...
  • JavaDB

    千次阅读 2008-04-22 11:35:26
  • Java DB的两种连接方式

    千次阅读 2013-08-15 22:05:08
    Derby有两种连接方式  第一种连接方式就是像MySQL、Oracle、SQL Server这样使用连接字符串进行连接的Network工作方式,其默认端口为1527。连接串写一写昂:  jdbc:derby://localhost:1527/[;属性1=属性值1[;...
  • Android xUtils框架(一) DbUtils

    万次阅读 2015-05-20 21:05:09
    框架地址: 需要的权限 uses-permission android:name="android.permission.INTERNET" />  uses-permission android:name="android.permission.WRITE_EXTERNAL_STO
  • centos下卸载jdk

    万次阅读 2013-05-21 10:22:11 第一、以root账号登录如下 [whutsun@localhost ~]$ su root Password:  ...[root@localhost whutsun]# rpm -qa|
  • 项目中,使用java“用户名+... MongoClient mongoClient = new MongoClient(HOST, PORT); DB db = mongoClient.getDB(DB_NAME); // 认证失败auth=false boolean auth = db.authenticate(USERNAME, PASSWORD.toC...
  • 第一段 java.lang.IllegalArgumentException: db.num is null 第二段:org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org....
  • Java RocksDB的详细介绍

    千次阅读 2019-04-19 20:36:33
    文章目录RocksDB简介maven jar包下载 RocksDB简介 RocksDB是 Facebook 开发的一款高效的数据库软件,其采用C++编写。其是一款key-value型数据存储软件,其具有四大特点。 **高性能:**RocksDB使用一套日志结构的...
  • Java中计算两个日期间隔多少天

    万次阅读 2017-02-23 15:36:55
    String dbtime1 = "2017-02-23"; //第二个日期 String dbtime2 = "2017-02-22"; //第一个日期 //算两个日期间隔多少天 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date date1 = format....
  • Neo4j - 原生Java API

    万次阅读 2017-02-07 15:50:46
    在本章中,我们将使用Neo4j Native Java API开发和测试Java应用程序。 我们将在下一章讨论Neo4j Cypher Java API。 Neo4j原生Java API示例 此示例演示如何在Eclipse IDE中开发Java应用程序以开发和测试...
  • java使用枚举封装错误码及错误信息

    万次阅读 2017-02-08 13:36:29
    使用枚举类型来封装project中所需要的错误码和错误信息,十分方便。  用法如下:  package com.dear.simpler.dbservice; /** * * @author lixiang *使用枚举类型来封装异常码和异常信息 ... DB_SERVICE_OK(2
  • import; import java.util.Iterator; import java.util.Set; import com.mongodb.DB; import com.mongodb.DBCollection; import com.mongodb.Mongo; import com.m
  • java.lang.StackOverflowError

    万次阅读 2013-04-06 23:46:48
    做毕设出现一个java.lang.StackOverflowError异常。弄了半天,又是问高手,又是查资料的。最后发现,解决问题啦!特记录下来! StackOverflowError是由于当前线程的栈满了 ,也就是函数调用层级过多导致。 ...
  • double判断是否为0

    万次阅读 2017-06-29 09:56:21
    double db; if(db>=(-1e-6)&&db
  • 通过db.properties文件的存放位置谈java项目及Web项目的路径问题
1 2 3 4 5 ... 20
收藏数 387,321
精华内容 154,928