alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

HSQLDB example source code file (TestSelfTempTable1.txt)

This example HSQLDB source code file (TestSelfTempTable1.txt) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - HSQLDB tags/keywords

autocommit, commit, connect, connect, create, create, immediately, password, password, sa, set, shutdown, user, user

The HSQLDB TestSelfTempTable1.txt source code

/*s*/DROP tmptbl1 IF EXISTS;
/*s*/DROP tmptbl2 IF EXISTS;
/*s*/DROP user altuser1;
/*s*/DROP user altuser2;

CREATE USER altuser1 PASSWORD password;
CREATE USER altuser2 PASSWORD password;
SET AUTOCOMMIT false;
/*u0*/CREATE TEMP TABLE tmptbl1 (i int);
/*u0*/CREATE TEMP TABLE tmptbl2 (i int);
/*u1*/INSERT INTO tmptbl1 VALUES(1);
/*u1*/INSERT INTO tmptbl1 VALUES(2);
/*c2*/SELECT * FROM tmptbl1;
COMMIT;
-- Purposefully not committing these inserts
/*u1*/INSERT INTO tmptbl2 VALUES(1);
/*u1*/INSERT INTO tmptbl2 VALUES(2);
/*c0*/SELECT * FROM tmptbl1;
/*c2*/SELECT * FROM tmptbl2;
/*u0*/GRANT ALL ON tmptbl1 TO altuser1;
/*u0*/GRANT ALL ON tmptbl2 TO altuser1;

CONNECT USER altuser1 PASSWORD password;
/*c0*/SELECT * FROM tmptbl1;
/*c0*/SELECT * FROM tmptbl2;

CONNECT USER altuser2 PASSWORD password;
/*e*/SELECT * FROM tmptbl1;
/*e*/SELECT * FROM tmptbl2;

CONNECT USER SA password "";
SHUTDOWN IMMEDIATELY;

Other HSQLDB examples (source code examples)

Here is a short list of links related to this HSQLDB TestSelfTempTable1.txt source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.