Programmatically setting derby.system.home

后端 未结 1 1057
臣服心动
臣服心动 2021-02-06 10:10

Need to move the database and log files of JavaDB (derby) db files into deployment directories. The database is working in the application startup directory as JavaDB creates a

相关标签:
1条回答
  • 2021-02-06 11:06

    The documentation (Derby developers guide: Setting Derby properties) suggests something like:

    Properties p = System.getProperties();
    p.setProperty("derby.system.home", "C:\databases\sample");
    

    I've also seen

    /* setting an attribute in a Properties object */
    Properties myProps = new Properties();
    myProps.put("create", "true");
    Connection conn = DriverManager.getConnection("jdbc:derby:sampleDB", myProps);
    
    0 讨论(0)
提交回复
热议问题