Announcement Announcement Module
Collapse
No announcement yet.
does SqlUpdate.compile() create PreparedStatement? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • does SqlUpdate.compile() create PreparedStatement?

    I am kind of new to Spring, I am trying to figure out if compile() function of SqlUpdate,SqlFunction,MappingSqlQuery creates PreparedStatement or it is being created only when you call execute() on the subclass of these classes?

    I am initializing all my objects which subsclass SqlUpdate,etc.. in constructor of my DAO, so I will not need to new them each time I want to use them. But if compile() creates PreparedStatements, I think it is not a good idea to have several PreparedStatements open all the time. :roll:

    Thanks,
    Oleg

  • #2
    Actualy, SqlUpdate / SqlFunction / MappingSqlQuery extend SqlOperation. The later does not create a PreparedStatement when compile is invoked, it, instead, creates a PreparedStatementCreatorFactory that will create a PreparedStatement when execute is invoked.
    HTH

    Comment

    Working...
    X