facebook

Scaffold Spring CRUD new-connection-sql?

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #311488 Reply

    skassam
    Member

    I have created a Scaffold Sprng CRUD application and I need to execute a particular SQL statement when a db connection is made.

    Which file would that go in?

    Thanks In Advance!

    #311495 Reply

    davemeurer
    Member

    Hello,

    I’m not entirely sure I understand the question. Are you trying to create some type of audit statement that logs connections? Or do you have a SQL statement that you would like to use in the application?

    If the you are asking the latter, then you can create a named query in the domain object, and then call it in the DAO.

    If you are asking the former, I would recommend looking at what atomikos can provide, which is in the [app]-generated-dao-context.xml file, or seeing what the database can do.

    Kind regards,
    Dave

    #311518 Reply

    skassam
    Member

    Thanks Dave,
    I am referring to the latter. I am going to try using the atomikos property “testQuery” and validate it. Ill report back my results. Thanks.

    #311522 Reply

    skassam
    Member

    the testQuery doesnt work quite like I expected and there is no facility like <new-connection-sql>. Do you know if it is possible to extend AtomikosNonXADataSourceBean so I can use by custom class to do what I need it to do.

    In a nutshell, I need to run a few sql statements that change the db session state for what I need to do.

    TIA,
    Shinan

    #311529 Reply

    davemeurer
    Member

    Hi Shinan,

    The best place to ask this question may be the atomikos forums, which I’ve noticed you already have done – so, I wanted to post the link here in case others are curious about the same question: http://fogbugz.atomikos.com/default.asp?community.6.1772.1.

    Kind regards,
    Dave

    #311531 Reply

    skassam
    Member

    Thanks!

    I am going to try using the Spring Transaction Manager and DBCP for the connection pooling.

    #311632 Reply

    skassam
    Member

    I was just able to change the connection pooling to dbcp and everything worked great.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Scaffold Spring CRUD new-connection-sql?

You must be logged in to post in the forum log in