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

  • Home
  • SEARCH
  • 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 9175293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:53:21+00:00 2026-06-17T16:53:21+00:00

I am in development phase, trying to use in-memory DB and load it with

  • 0

I am in development phase, trying to use in-memory DB and load it with some data during Grails application start up. My question is, is there any way to write/configure SQL insert statements that can be executed during startup.

  • 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-06-17T16:53:22+00:00Added an answer on June 17, 2026 at 4:53 pm

    You can do this in BootStrap.groovy. If you add a dependency injection for the dataSource bean you can use it with a groovy.sql.Sql instance to do inserts:

    import groovy.sql.Sql
    
    class BootStrap {
    
       def dataSource
    
       def init = { servletContext ->
          def sql = new Sql(dataSource)
          sql.executeUpdate(
             'insert into some_table(foo, bar) values(?, ?)',
             ['x', 'y'])
       }
    }
    

    You would probably be better off using GORM though, assuming these are tables that are managed with domain classes. E.g. run something like new Book(author: 'me', title: 'some title').save()

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

Sidebar

Related Questions

During development, I use this to load the latest jQuery: <script src=http://www.google.com/jsapi></script> <script type=text/javascript>
I have a testing class within my project that is there during the development
In the development phase of an application i got strucked with one place that,
I use the real IIS 7.5 server in the development phase. The site points
I am in the development phase of an iPad application in which user can
As part of the development phase of my iPhone app it would be really
Currently in development and testing phase, in order to distribute my app amoung test
In early phases of software development projects the conceptual data model is designed. In
My development environment at work is not sufficient to process ALL of the data
During development of a PostgreSQL database, I made foreign keys in every table. The

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.