Is there any way to test that SQL scripts contain standard SQL with java/junit tests?
Currently we have sql scripts for creating a database etc. in a Postgres db, but when using hsqldb everything fails. That's why I wonder if any java tools exist for testing if sql statements are standard sql.
Or would it just be wise to create differe...
Could you tell me the differences between HSQLDB and JavaDB? And which one should I use in unit testing, assuming that I only use standard features? Thanks.
...
I have the following definition for an id field in an entity that is mapped to a table in HSQLDB.
...
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "ID")
private Integer id;
...
But this does not seem to generate the an unique id; instead an attempt is made to insert null into the column which results in failure. If...
I don't want to use it in embedded mode as I may allow other external applications to access it as well. And I want to execute the startup of the server at the same time as Tomcat loads my application (or just when tomcat runs for that matter). This is so that I don't have to ask clients to manually run hsqldb with a command or script ...
Is it possible to limit the number of rows that are updated using Hibernate/HQL? For instance:
Query q = em.createQuery("UPDATE MyObj o Set o.prop = :prop");
q.setParameter("prop", "foo");
q.setMaxResults(myLimit);
int res = q.executeUpdate();
if (res > myLimit) {
// This is entering here and I don't want it to!
}
I've been Goog...
If I have a FooBar entity with a fizzBuzz field, what will the resulting table and column names be in HSQL? Would they be FOO_BAR and FIZZ_BUZZ? Or FooBar and fizzBuzz? Or . . .
...
I am planning to start a commercial web project (like e.g. facebook) which requires a database.
I've read through all the licenses and FAQ's of MySQL, PostgreSQL and HSQLDB but I am still not certain if I need to purchase a license (commercial type) or have to publish the source code of my web project (open source license) since I am no...
Dear SQL gurus ;-)
I have the following query (inherited from legacy) similar to
SELECT bla FROM table
WHERE
some.id IN (
SELECT id FROM (
SELECT some FROM tag WHERE bla
UNION
SELECT some FROM dossierinfo WHERE bla
ORDER BY tag LIMIT :limit OFFSET :offset
) AS aggregated
WHERE dossier_type = ...
I have JDBC code which inserts into a database table by executing a PreparedStatement. When I run the code on an in-memory HSQLDB database (as part of a JUnit test) I get a SQLFeatureNotSupportedException with the only information being the message "feature not supported" and the vendor code -1500. What I'm doing is a basic insertion i...
Hello,
I have an application where many "unit" tests use a real connection to an Oracle database during their execution.
As you can imagine, these tests take too much time to be executed, as they need to initialize some Spring contexts, and communicate to the Oracle instance. In addition to that, we have to manage complex mechanisms, s...
I've created a test application on my PC to get familiar with Hibernate on an HSQLDB.
I made an executable JAR and moved the application on to a Linux VM. When I run the same program after set up, my HSQLDB throws the following message when I try to run the test app:
A pre-9.0 client attemtped to connect. We rejected them.
This occu...
I have a big multi-module Maven project with thousands of tests.
Each test loads DAOs, services, etc using the SpringApplicationContext annotation.
My unitils configuration looks like this:
database.driverClassName=org.hsqldb.jdbcDriver
database.url=jdbc:hsqldb:file:mytestdb
database.schemaNames=PUBLIC
database.userName=sa
database.pass...
I am looking for information how to check if a database exists -- from Java code -- in hsqldb and in apache derby. In Mysql it is quite easy, because I can query a system table -- INFORMATION_SCHEMA.SCHEMATA -- but these two databases seem not to have such a table.
What is an alternative to mysql query:
SELECT SCHEMA_NAME FROM INFORM...
I have an in-memory data source:
java.sql.Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:testdb", "sa", "");
emf = Persistence.createEntityManagerFactory("manager");
But now I'm stuck. I want to use it as a JPA data source in a J2SE application. I've scoured the entire web but all info is related to J2EE.
<pe...
I'm setting up a standalone Java service with an in-process, in-memory HSQL database.
Persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
...
I have a sql file that creates a database in mysql:
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `mydb`...
Hello,
We are trying to use BIRT 2.3.0 Report Designer with HSqlDB version 1.7
On clicking on the "Test Connection" we get a Connection Successful message.
However, on clicking on the "Data Set" menu item we get a message "No Tables
found".
We have placed the "hsqldb.jar" in the location
"plugins/org.eclipse.birt.report.data.oda.jdbc-...
Using a test app to figure out problems with production application and hsqldb.
If I compile the test app with the hsqldb.jar file as an external jar in eclipse the program works. However, if I only have the jar file in my JRE system library I get a pre-9.0 client attempted to connect error from the database.
The two files are the exa...
Trying to get production application to work with hsqldb. The application is built with ant and the compile.classpath is set with hsqldb.jar and the application is executed with hsqldb.jar in the classpath. All versions of the jar file are the same and up to date, however, I'm getting a "pre-9.0 client attemtped to connect. We rejected...
Hi all,
I'm using a HSQLDB for an application that stores research data and there is quite a lot of data. HSQLDB insists on always loading the tables into memory. I've tried fixing this by setting hsqldb.default_table_type=cached in my persistence.xml but that does not work.
Is this the wrong place?
persistence.xml
<persistence-unit ...