derby

Case insensitive search in Java DB (Derby)

瘦欲@ 提交于 2019-12-07 03:16:28
问题 I'm using Derby and I can't find a way to do case insensitive search. For example, I have a table that I'm searching that contains "Hello" but I put a search query in for "hello" and at the moment I won't get a result, but I want to. I can't find the correct syntax for it. Sara 回答1: You can use the UPPER() or LOWER() SQL functions on both your search argument and the field, like in SELECT * FROM mytab WHERE UPPER(lastname) = UPPER('McDonalds') 回答2: The most common way to do this is to use

Hibernate5 HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections

喜欢而已 提交于 2019-12-07 03:11:46
问题 I have not actually written any code yet and I'm just trying to run mvn hibernate5-ddl:gen-ddl to convert an existing class to DDL. What could cause the warning ConnectionProviderInitiator - HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections ? Here's my persistence.xml <persistence> <persistence-unit name="manager1" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <properties>

How to use SEQUENCE in Apache Derby?

試著忘記壹切 提交于 2019-12-06 23:00:24
问题 I'd like to use SEQUENCE support in Apache Derby 10.7. I've created the sequence with the following statement: CREATE SEQUENCE SAMPLE_SEQ AS INT MAXVALUE 999999 CYCLE; How can I select next/current value from the SAMPLE_SEQ ? Could you please help me out with the query? 回答1: Apache Derby Doc says: Use a NEXT VALUE FOR expression Should be something like SELECT NEXT VALUE FOR SAMPLE_SEQ; 回答2: Use NEXT VALUE FOR as documented in the manual: http://db.apache.org/derby/docs/10.7/ref

Do I need to create separate index for primary key of relational database table

偶尔善良 提交于 2019-12-06 18:29:44
问题 If I create table with primary key is index automatically created for the table or does that need doing separately. i.e if this is the table ddl CREATE TABLE release(guid varchar(36) NOT NULL PRIMARY KEY, name varchar(255),xmldata CLOB(512 K)) do I also need to do CREATE INDEX release_idx ON release(guid) or not (I'm using Derby a database that comes with Java) 回答1: You don't need to. The primary key is already an index. 来源: https://stackoverflow.com/questions/14646014/do-i-need-to-create

Spring Batch JdbcPagingItemReader seems not paginating

回眸只為那壹抹淺笑 提交于 2019-12-06 16:53:11
I'm working on an app that indexes a bunch of files in an embedded Derby(10.12.1.1) DB and then are exported as one single tabulated file. The first part is working fine since the DB is created and all records are indexed. However, when I attempt to read from the DB using JdbcPagingItemReader and write to a file I only get the number of records specified in pageSize . So if the pageSize is 10, then I get a file with 10 lines and the rest of the records seem to be ignored. So far, I haven't been able to find whats is really going on and any help would be most welcome. Here is the

Apache Derby Embedded Mode Deployment

我只是一个虾纸丫 提交于 2019-12-06 13:35:35
I have a Java app that has an embedded Derby database (no hibernate though). The app is using the following properties: datasource.driverClassName = org.apache.derby.jdbc.EmbeddedDriver datasource.url = jdbc:derby:C:/derby/mydb; datasource.username = 1234 datasource.password = 1234 Everything is working fine and great. Now I need to package everything and give it to a client to install on their GlassFish server now I don't want the client to install Derby and I don't want them to know that the application is using a database. The questions are: where should Derby be in the JAR? and What should

Spring Boot: Apache derby pool empty. Unable to fetch a connection in 30 seconds

怎甘沉沦 提交于 2019-12-06 12:12:38
After some time of running I'm getting this error. Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: Unable to acquire JDBC Connection; nested exception is org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection] with root cause org.apache.tomcat.jdbc.pool.PoolExhaustedException: [http-nio-8081-exec-5] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:100; busy:100; idle:0; lastwait:30000]. Here is the

Deployed war to tomcat can't throws java.lang.NoClassDefFoundError: javax/persistence/PersistenceException

强颜欢笑 提交于 2019-12-06 11:18:51
I'm new to this forum and also new to JPA / EJB. I'm trying to deploy a .war file containing a small application to a tomcat server. The application is using JTA to communicate with the Derby db. When I run and deploy the application from and eclipse top the tomcat server running in eclipse, everything works perfect, but when I export a .war file and try to browse the application it throws an java.lang.ClassNotFoundException: javax.persistence.PersistenceException. My persistence file looks like this: <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns

Hibernate/JPA + Derby - SELECT statement has too many items in GROUP BY, ORDER BY or select list

白昼怎懂夜的黑 提交于 2019-12-06 10:50:48
I use Hibernate for JPA DB mapping with Derby DB. For a complex object structure I am getting "org.apache.derby.client.am.SqlException: SELECT statement has too many items in GROUP BY, ORDER BY or select list": org.apache.derby.client.am.SqlException: SELECT statement has too many items in GROUP BY, ORDER BY or select list. org.apache.derby.client.am.Statement.completeSqlca(Unknown Source) org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source) org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source) org.apache.derby.client.net.NetStatementReply

Cannot alter column in existing table in java Derby database

久未见 提交于 2019-12-06 08:53:45
I am trying to alter my table by changing one of the columns in the table. But, I am encountering an error while I execute the following sql command - ALTER TABLE WALLETUSER MODIFY WALLETUSERNAME VARCHAR NOT NULL; The error i receive is - Error code -1, SQL state 42X01: Syntax error: Encountered "MODIFY" at line 1, column 24. Would appreciate any help. Try this instead: ALTER TABLE WALLETUSER ALTER COLUMN WALLETUSERNAME NOT NULL; Full syntax guide: ALTER TABLE table-Name { ADD COLUMN column-definition | ADD CONSTRAINT clause | DROP [ COLUMN ] column-name [ CASCADE | RESTRICT ] DROP { PRIMARY