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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:53:48+00:00 2026-06-05T18:53:48+00:00

If I only ever use one Statement at a time would it be worthwhile

  • 0

If I only ever use one Statement at a time would it be worthwhile cacheing it along with my Connection. I already cache the connection so I could cache the statement at almost no cost at all.

Essentially I suppose I am asking if there is any cost/overhead to creating a statement. I fully understand the benefits of creating prepared statements. I am talking specifically about Connection.createStatement() here.

  • 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-05T18:53:50+00:00Added an answer on June 5, 2026 at 6:53 pm

    Some research into an open-source jdbc driver (jtds) suggests the following object overhead for each Statement created. I am trying to count the cost of creating a new Statement every time I want to query the database rather than holding one single cached one and reusing it:

    1. A Connection – Presumably cached so insignificant.
    2. A TdsCore – Looks like a protocol implementation but it is cached so insignificant.
    3. A ResultSet.
    4. An ArrayList of batched items.
    5. An ArrayList of open ResultSets.
    6. Column meta data.

    So it looks like the highest proportion of the cost of Statements involves what is left around by any query that has been run.

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

Sidebar

Related Questions

when ever i use window.location.href=//some url it always open a new window, this only
I have an ICollection that I know will only ever have one member. Currently,
I have a timer in my class that is I only ever want one
Should I only ever have one box2d contact listener in a project? Let's say
I have only ever dealt with database querys before in the old fashion that
I have a simple producer/consumer scenario, where there is only ever a single item
In my program, I've got a bunch of classes that will only ever have
I have a collection of the form: map<key, list<object> > I only ever insert
This is the only place I've ever seen and , or and not listed
Only Teradata SQL is available for use. I'm trying to dynamically create a list

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.