Announcement Announcement Module
Collapse
No announcement yet.
How Spring support SQLJ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How Spring support SQLJ?

    Just wondering how Spring support SQL?

  • #2
    Spring does not support SQLJ directly, although it's possible you could get some mileage out of Spring's JDBC support in a SQLJ environment.

    I did consider SQLJ support at one point, but didn't proceed with it because it appeared that Oracle were moving away from SQLJ.

    Comment


    • #3
      There are lots of people in my company using SQLJ for accessing DB2 in mainframe. It is like company standard they defined long time ago. I am trying to promote Spring Framework to this huge financial firm. If Spring can provide supports for SQLJ. Then they have a new reason to adopt it. Do you have any suggestions?

      Comment


      • #4
        I think we could, without to much trouble, add an SqljTemplate class with some basic functionality. We could start with a simple callback method "doInDefaultContext" and then add additional support as needed.

        This is an example of what this might look like:
        Code:
        SqljTemplate = new SqljTemplate(dataSource);
        
        Number count = (Number) sqljTemplate.execute(
        
            new SqljDefaultContextCallback() {
                
                public Object doInDefaultContext(sqlj.runtime.DefaultContext defaultContext) 
                                throws SQLException, DataAccessException {
                    Number myCount;
                    #sql {
                        select count(*) into :myCount
                        from my_table
                        where some_code = 'X'
                    };
                    return Number;        
                }
            });

        Comment


        • #5
          SQLJ over Spring

          Hi everybody,
          I have already used Jdbc-Spring to access oracle DB in my applications, but recently a new need related to access DB2 appears as well.
          I have a doubt: is there a way to use Spring to hide the open-close operations that my SQLJ code requires?
          Thanks in advance.
          Leucir Jr.

          Comment


          • #6
            Spring Support for Sqlj Now On JIRA

            Originally posted by shaogang View Post
            Just wondering how Spring support SQL?
            Hi folks.

            The Spring support for SQLJ has been uploaded on the Spring JIRA. Please see the link below to access the source code.

            http://opensource.atlassian.com/proj...rowse/SPR-1375

            Comment


            • #7
              Its now an incubation spring extension project - http://www.springsource.org/extensions/se-sqlj

              Comment

              Working...
              X