derby

How to shutdown Derby in-memory database Properly

三世轮回 提交于 2019-11-29 01:04:57
问题 I'm using derby as an embedded database. Furthermore, I'm using it's in-memory database option for my unit tests. What I can't figure out is how to properly shut down (A quick look at the code) the Derby database. I beleive I have it working for a standard database but I'm getting different exceptions when attempt similar code on a in-memory database. I'm going to omit details, I'll add them if other feel are needed. Basically, I'm trying to shut down my database in these two fashions where

using hibernate with embedded derby

浪尽此生 提交于 2019-11-29 00:40:42
问题 i want to use hibernate with embedded derby in a standalone application , and i have some questions: What jars do i need ? What are the necessary hibernate configuration ? Are there any other necessary configuration ? Does it have any problems/limitations with queries/criteria ? if you can also suggest me some good tutorial for this approach that will be preferable, thanks in advance. 回答1: I use Apache Derby with Hibernate for testing one of my project's model classes (their equals , hashCode

@GeneratedValue(strategy = GenerationType.AUTO) not working as thought

喜欢而已 提交于 2019-11-28 23:16:00
I'm trying to persist an object to a database. Keep getting 'Column ID cannot accept null value error'. My object looks like this: @Entity public class TestTable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id = 0; @Column(nullable=false, length=256) private String data = ""; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getData() { return data; } public void setData(String data) { this.data = data; } } My persist function: public static synchronized boolean persistObject(Object obj){ boolean success = true;

Embedded (pure Java) database for Clojure

北慕城南 提交于 2019-11-28 19:28:45
I'm in need for an embedded database for a Clojure application. Maybe it's the same criteria as for any other Java application but I rather get some other people's opinion anyway. I'm not picking SQLite because that's not pure Java so distribution of a standalone application gets much more complex. It seems the way to go is Apache Derby. Anything else I should consider? Without a doubt, H2 Here are the settings, (def demo-settings { :classname "org.h2.Driver" :subprotocol "h2:file" :subname (str (System/getProperty "user.dir") "/" "demo") :user "sa" :password "" } ) And then the usual Clojure

Java standalone app with JPA + Hibernate (or similar) and Apache Derby embedded DB

我的未来我决定 提交于 2019-11-28 18:02:50
I want to create a Java standalone Java application that will use the Apache Derby Embedded DB. I want to use JPA since I'm quite familiar with it and probably over Hibernate ( but others are welcome if it is to get easier). Is there any example that uses JPA over Hibernate over a Derby embedded db? I was searching around but I can't find any useful example code. I would like something like a tutorial that will tell which libs I need to add in my classpath, which are the essential files and what I need to do. carlspring If you are using Maven for your build, you can use the derby-maven-plugin

org.hibernate.hql.internal.ast.QuerySyntaxException: table is not mapped

感情迁移 提交于 2019-11-28 17:22:39
I have example web application Hibernate 4.3.5 + Derby database 10.10.1.1+ Glassfish4.0 with IDE NetBeans 8.0Beta. I have the next exception: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: CUSTOMERV is not mapped at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:189) at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:109) at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:95) at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement

Getting rid of derby.log

允我心安 提交于 2019-11-28 16:29:08
问题 I'm using the Apache Derby embedded database for unit testing in a Maven project. Unfortunately whenever I run the test I end up with the derby.log file in the root of the project. The database itself is created in the target directory ( jdbc:derby:target/unittest-db;create=true ) so that is not a problem. After consulting the reference guide I tried setting the logDevice parameter on the JDBC url ( jdbc:derby:target/unittest-db;create=true;logDevice=/mylogs ) but that seems to be for a

ResultSet is not updatable [duplicate]

可紊 提交于 2019-11-28 14:16:56
This question already has an answer here: updateLong not allowed in ResultSet 3 answers I have read all of the "updatable" post on stackoverflow (and elsewhere on the web) but to no avail. My code was working fine then it stopped say the resultset was not updatable. This is across the 4 data files I use in the JDBC derby database. The files all have keys. I don't know where else to look. I wrote the test code below to demonstrate the problem. private void jButton1MouseClicked(java.awt.event.MouseEvent evt) { try { String uName = "guest"; String uPass = "guest"; String host = "jdbc:derby://127

Omit schema in the DERBY Query

假如想象 提交于 2019-11-28 13:42:47
I have created a database named 'movie_db', set default schema to APP. Then created a sample table named 'USERS'. My connection to DB is as follows: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="org.apache.derby.jdbc.ClientDriver"/> <property name="url" value="jdbc:derby://localhost:1527/movie_db"/> <property name="username" value="root"/> <property name="password" value="pass"/> </bean> Now I want to write some tests and try to execute the following query: SELECT * FROM USERS; What I get: java.sql

How do you start derby in network server mode and still get an embedded connection?

99封情书 提交于 2019-11-28 12:20:01
I just want to know how I can start derby in network server mode and still be able to get an embedded connection? Thank you. You need to launch Derby in "embedded server mode". If you are already using Derby in embedded mode, this can be enabled by providing the necessary files in your classpath, then specifying a handful of command line arguments when launching the application. First make sure the following jars are in your application's runtime classpath. derby.jar derbynet.jar Then add the following command line options to the Java command used to launch your application. If the class files