简体   繁体   English

使用Apache Derby创建数据库

[英]Create a database with Apache Derby

I am using the Apache Derby in a java application. 我在Java应用程序中使用Apache Derby。 On the first launch, I want to create a database and set username and password. 在第一次启动时,我想创建一个数据库并设置用户名和密码。

CONNECTION = DriverManager.getConnection("jdbc:derby://localhost:1527/DB;create=true",
                "database", "password");

I am not sure that the password is set when the database is created, how can I programmatically set the password after creating the database? 我不确定创建数据库时是否设置了密码,创建数据库后如何以编程方式设置密码?

After creating the database, I tried with a wrong password and i was still able to connect and execute queries. 创建数据库后,我尝试使用错误的密码,但我仍然能够连接并执行查询。

I am not sure that the password is set when the database is created 我不确定在创建数据库时是否设置了密码

If you are not sure, why don't you just try to reconnect with the wrong password and see if it lets you? 如果不确定,为什么不尝试使用错误的密码重新连接,看看是否可以使用?

Or if you want to be completely sure how it works, just read the source code. 或者,如果您想完全确定其工作方式,请阅读源代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM