Friday, August 03, 2012

Setup HSQLDB on MAC

1.  Start the Server


Hsqldb Server

This is the preferred way of running a database server and the fastest one. A proprietary communications protocol is used for this mode. A command similar to those used for running tools and described above is used for running the server. The following example of the command for starting the server starts the server with one (default) database with files named "mydb.*".
    java -cp ../lib/hsqldb.jar org.hsqldb.Server -database.0 file:xdb -dbname.0 xdb
The command line argument -? can be used to get a list of available arguments.

Note that both "xdb" is used for both File and database name.


2. Start the DB Manager Swing application

Running Tools

All tools can be run in the standard way for archived Java classes. In the following example the AWT version of the Database Manager, the hsqldb.jar is located in the directory ../lib relative to the current directory.
    java -cp ../lib/hsqldb.jar org.hsqldb.util.DatabaseManager
If hsqldb.jar is in the current directory, the command would change to:
    java -cp hsqldb.jar org.hsqldb.util.DatabaseManager
Main classes for the Hsqldb tools
  • org.hsqldb.util.DatabaseManager
  • org.hsqldb.util.DatabaseManagerSwing
  • org.hsqldb.util.Transfer
  • org.hsqldb.util.QueryTool
  • org.hsqldb.util.SqlTool



3. Setup the tool to Connect to the HSQL DB



Use these setting in the connection to setting to run the server.



4. Start the DB Manager Swing application

HSQL needs to be setup in JPA persistence.xml to perform connections.


<persistence-unit name="Stocks" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>nJTA</non-jta-data-source>
        <class>net.vinant.db.Stock</class>
        <properties>
        <!-- jdbc:hsqldb:mdb -->
        <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:hsql://localhost/mdb" />
        <property name="javax.persistence.jdbc.user" value="SA"/>
        <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
        <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add', ForeignKeys=true)"/>
<property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>        
     <property name="openjpa.jdbc.DBDictionary" value="hsql" />
<property name="openjpa.jdbc.Schema" value="PUBLIC" />
        </properties>   
    </persistence-unit> 
</persistence>



Enjoy!


11 comments:

gowsalya said...

After reading your post I understood that last week was with full of surprises and happiness for you. Congratz! Even though the website is work related, you can update small events in your life and share your happiness with us too.
Data Science training in Chennai
Data science online training

priya said...

This is quite educational arrange. It has famous breeding about what I rarity to vouch. Colossal proverb. This trumpet is a famous tone to nab to troths. Congratulations on a career well achieved. This arrange is synchronous s informative impolites festivity to pity. I appreciated what you ok extremely here 
Data Science training in rajaji nagar
Data Science with Python training in chennai
Data Science training in electronic city
Data Science training in USA
Data science training in pune

ragul ragul said...

I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
Microsoft azure training in Bangalore
Power bi training in Chennai


aarthi said...

Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time.
I appreciate your post and look forward to more.
Java training in Chennai

Java training in Bangalore

Java training in Hyderabad

Java Training in Coimbatore

Java Online Training

Jayalakshmi said...

Hi, am a big follower of your blog. I am really happy to found such a helpful and fascinating post that is written in well manner. Thanks for sharing such an informative post. keep update your blog.
java training in chennai

java training in tambaram

aws training in chennai

aws training in tambaram

python training in chennai

python training in tambaram

selenium training in chennai

selenium training in tambaram

jeni said...

I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously in their life, he/she can earn his living by doing blogging.thank you for this article.

angular js training in chennai

angular js training in velachery

full stack training in chennai

full stack training in velachery

php training in chennai

php training in velachery

photoshop training in chennai

photoshop training in velachery

deiva said...

Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time.
I appreciate your post and look forward to more.
oracle training in chennai

oracle training in omr

oracle dba training in chennai

oracle dba training in omr

ccna training in chennai

ccna training in omr

seo training in chennai

seo training in omr


shiny said...

I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing

data science training in chennai

data science training in annanagar

android training in chennai

android training in annanagar

devops training in chennai

devops training in annanagar

artificial intelligence training in chennai

artificial intelligence training in annanagar

praveen said...

First i got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks,
data science training in chennai

data science training in porur

android training in chennai

android training in porur

devops training in chennai

devops training in porur

artificial intelligence training in chennai

artificial intelligence training in porur

praveen said...

First i got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks,
data science training in chennai

data science training in porur

android training in chennai

android training in porur

devops training in chennai

devops training in porur

artificial intelligence training in chennai

artificial intelligence training in porur

Anonymous said...

very well written.
SQL training in Pune