Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6752771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:05:01+00:00 2026-05-26T13:05:01+00:00

I was wondering how to persist data to a hsqldb. For example I am

  • 0

I was wondering how to persist data to a hsqldb. For example I am trying to save a simple name to a database but I cant seem to figure out how to persist it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:05:02+00:00Added an answer on May 26, 2026 at 1:05 pm

    The recommended approach is to create a domain class with a String name property. Then you can save it, and you’re done. First, create the domain class:

    $ grails create-domain-class com.foo.Person
    

    Then edit the grails-app/domain/com/foo/Person.groovy:

    package com.foo
    
    class Person {
       String name
    }
    

    In controller actions or service methods you can create, save, and retrieve data:

    def heMan = new Person(name: 'He Man')
    if ( !heMan.save() ) {
       // Handle problems saving (e.g. constraint violations)
    }
    
    def h = Person.findByName('He Man')
    println h.name
    

    An alternative approach is to work with JDBC directly. You can have dataSource bean automatically injected into your controller, then use the groovy.sql.Sql class to query that dataSource. Check out this stackoverflow.com question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MLDBM to persist some Perl data structures and I'm wondering if there's
I'm wondering what is the easiest way to persist a string value, once the
Wondering if anyone has gotten the infamous database is locked error from Trac and
Wondering if anybody out there has any success in using the JDEdwards XMLInterop functionality.
Wondering if anyone can help me with this annoying but trivial (in terms of
I'm trying to learn more about database transactions, I found the ACID rule of
I am wondering if there is a way to persist variables in the business
Simple question regarding data persistance between application sessions. My application allows the user to
I'm wondering if there's a way to save window configurations across emacs sessions. I
What is the best way to persist/save printer settings in .Net? There used to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.