无法创建嵌入式 derby java
我在 JDBC 模式下创建了一个嵌入式 derby,但是当我尝试在 java 类中访问它时,出现错误:
java.sql.SQLException: Failed to create database 'myDB', see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:207)
at embededderby.Main.createConnection(Main.java:42)
at embededderby.Main.main(Main.java:30)
I created a embedded derby in JDBC mode but when I try to access it in java class it gives me error:
java.sql.SQLException: Failed to create database 'myDB', see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:207)
at embededderby.Main.createConnection(Main.java:42)
at embededderby.Main.main(Main.java:30)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,
配置您的文件夹以创建数据库:
然后
使用属性
driverClassName = "org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:SolofutbolParaguayDB;create=true" //创建数据库一个新的数据库
示例
First of all,
config your folder to create a Database with:
and then
create your database with properties
driverClassName = "org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:SolofutbolParaguayDB;create=true" //to create a new Db
Example
当它说“查看下一个异常以获取详细信息”时,具体操作方法如下: http://wiki .apache.org/db-derby/UnwindExceptionChain
When it says "see the next exception for details", here's how to do that: http://wiki.apache.org/db-derby/UnwindExceptionChain