How to run H2 database in server mode?

As the exception message says, “Database may be already in use”. You need to close all other connection(s), to make sure the database is not open in another process concurrently. By the way, don’t use AUTO_SERVER=TRUE and the server mode at the same time. See the documentation for the automatic mixed mode. Use either one. … Read more

H2 database string to timestamp

According to my test, with H2 version 1.3.170, the milliseconds are not actually zero, but 069: select * from test; ID DATE 1 2012-09-17 18:47:52.069 The same happens if you run: call parsedatetime(’17-09-2012 18:47:52.69′, ‘dd-MM-yyyy hh:mm:ss.SS’); If you add a zero then it works: call parsedatetime(’17-09-2012 18:47:52.690′, ‘dd-MM-yyyy hh:mm:ss.SS’); H2 internally uses java.text.SimpleDateFormat, so it … Read more

insert a BLOB via a sql script?

For testing, you can insert literal hex bytes or use the RAWTOHEX(string) function, as shown below. create table a(id integer, item blob); insert into a values(1,’54455354′); insert into a values(2, RAWTOHEX(‘Test’)); select UTF8TOSTRING(item) from a; TEST Test Addendum: For loading BLOB fields from a file, FILE_READ(fileNameString) may be a useful alternative. insert into a values(3, … Read more

H2: how to tell if table exists?

First: check the case in which you type tables’ names. It’s very important. word_types and WORD_TYPES are two different tables. Second: If you want to check if table exists and if it doesn’t then create one, I recommend you to use the following example: CREATE TABLE IF NOT EXISTS TEST(ID INT PRIMARY KEY, NAME VARCHAR(255));

create if not exists view?

From section 12.1.12. CREATE VIEW Syntax of the MySQL 5.0 Reference Manual: CREATE VIEW Syntax CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}] [DEFINER = { user | CURRENT_USER }] [SQL SECURITY { DEFINER | INVOKER }] VIEW view_name [(column_list)] AS select_statement [WITH [CASCADED | LOCAL] CHECK OPTION] The CREATE VIEW statement creates … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)