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 8492987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:52:56+00:00 2026-06-10T22:52:56+00:00

After running into this question today: Grails query not using GORM I wonder if

  • 0

After running into this question today: Grails query not using GORM I wonder if using groovy.sql.Sql or JDBC comes with the benefits of connection pooling?

I can see under some circumstances how going GORMless could be beneficial, but lack of conn pooling would eliminate it as an option.

Would we also get the benefits of prepared statements?

  • 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-10T22:52:58+00:00Added an answer on June 10, 2026 at 10:52 pm

    One of the main uses of a DataSource is to provide connection pooling. If you have set pooled = true in DataSource.groovy then the injected dataSource will give you a connection from the pool when you execute the query.

    Groovy SQL also provides querying using prepared statements:

    def sql = new Sql(dataSource)
    def params = [10, 'Groovy', 'http://groovy.codehaus.org']
    sql.execute 'insert into PROJECT (id, name, url) values (?, ?, ?)', params
    

    You can also enable PreparedStatement caching on the Sql object for performance:

    sql.cacheStatements = true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After changing the import as a from-import i'm running into this error: from datetime
After running this query statement with my database: select * from articles where content
After running into this issue for the 10 billionth time and nearly whipping my
After running into the Yii asset engine I've read the official documentation (http://www.yiiframework.com/wiki/148/understanding-assets/). I
I'm exploring package building on Windows 7 but have been running into trouble after
After running code from my previous question , I get a result set from
After running the following SQL statements, you will see that, MySQL has automatically created
This relates to another question I asked earlier today. I built SVN 1.6.2 from
Not sure where to post this question, but I am concerned about the security
I've been working on a prototype Backbone application using Backbone.LayoutManager and I'm running into

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.