Announcement Announcement Module
Collapse
No announcement yet.
setting fetchsize in SimpleJdbcTemplate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • setting fetchsize in SimpleJdbcTemplate

    Hello,
    I see that this has been discussed in the thread http://forum.springsource.org/showthread.php?t=50401

    but i still don't find how to set fetchsize in SimpleJdbcTemplate directly.

    Please help.

    Thanks

  • #2
    Spring experts,
    Please shed some light on this.

    Comment


    • #3
      hello, at least, please tell me whether this can be done or not.

      Thanks

      Comment


      • #4
        Originally posted by techluver View Post
        hello, at least, please tell me whether this can be done or not.

        Thanks
        Do you not have a MAX ROWS type ability in your RDMS?
        Are you wanting to maximize the number of rows returned? Also there is a setMaxRows in the JdbcTemplate as well. I realize this is not the same as SimpleJdbcTemplate.
        Last edited by darted; Mar 1st, 2010, 03:55 PM.

        Comment


        • #5
          I dont find any setter for fetchsize in SimpleJdbcTemplate. thats problem I'm facing now

          Comment


          • #6
            Originally posted by techluver View Post
            I dont find any setter for fetchsize in SimpleJdbcTemplate. thats problem I'm facing now
            Which is why I suggested JdbcTemplate vs. SimpleJdbcTemplate. What you are perhaps wanting to do is more aligned with that template.

            Comment


            • #7
              You can use it like this.

              Guys,

              You can set jdbcTemplate fetchsize and use SimpleJdbcTemplate like this:

              SimpleJdbcTemplate simpleJdbcTemplate = new SimpleJdbcTemplate(jdbcTemplate);

              This works because we use it.

              Comment


              • #8
                Hi

                OR you can access SimpleJdbcTemplate's internal JdbcOperations object like this:
                Code:
                   @Test
                   public void accessJdbcOperations() throws Exception
                   {
                      SimpleJdbcTemplate simpleJdbc = new SimpleJdbcTemplate(this.dataSource);
                      assertTrue(simpleJdbc.getJdbcOperations() instanceof JdbcTemplate);
                      ((JdbcTemplate)simpleJdbc.getJdbcOperations()).setFetchSize(100);
                   }
                regards
                Grzegorz Grzybek

                Comment


                • #9
                  this is what i'm looking for. thx a lot Grzegorz Grzybek & srikanthradix

                  Comment

                  Working...
                  X