Announcement Announcement Module
Collapse
No announcement yet.
DB2 database support in Roo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Great!

    Glad it all works now. If Roo is adding that trailing space by default, and that prevents the DB2 driver loading, it would be great if you could log it as a bug in the issue tracker so that the Roo team can fix it for everyone else.

    Comment


    • #17
      Jira Bug trace

      Yes it indeed adds that trailing space by itself preventing the correct loading of the driver class.
      I opened this bug in jira:

      http://jira.springframework.org/browse/ROO-674

      Comment


      • #18
        Congratulations to eltardo, the space at the end of the database.driverClassName is very difficult to see.

        In fact, it's a classic problem that I have since WAS 3.5 (extra whitespaces at the end of the driver class name in properties files)

        So it works for me, at last I can connect to DB2...

        ...however, now I have another problem (see the next POST)

        Comment


        • #19
          Now I can connect to DB2, however, all the JUnits have errors:

          org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query

          [...]

          Caused by: com.ibm.db2.jcc.b.SqlException: ILLEGAL SYMBOL "(". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: , FROM INTO

          I'm using DB2 OS/390 8.1.5.

          In the database log file (thanks to grg for the detailed JIRA ticket: ROO-603) I can find (please note that I've erased the name of the columns and I've changed the table name and alias):

          [ibm][db2][jcc][Time:1268665411311][Thread:main][Connection@1df5f21] prepareStatement (select * from ( select rownumber() over() as rownumber_, [B][I][sepparate commas columns] from TABLE ALIAS) as temp_ where rownumber_ <= ?) called

          It seems the second query, the one within the parenthesis, has no FROM clause.

          Directly in DB2 I have the next error codes:

          SQL0104N
          sqlcode : -104
          sqlstate : 42601

          What I'm doing wrong?

          Thank you very much in advance.

          Comment


          • #20
            At last it works for me.

            Thanks to all for the help (replies, JIRA tickets and so on)

            The remain problems were related to JPA (@Id, @Version, @GeneratedValue) and I have solved almost all of them.

            Comment


            • #21
              how to declare a field as primary key

              how to declare the field as primary key....using roo.....
              when creating a field using roo ...then how can i declare it as primary key...

              Comment


              • #22
                Originally posted by dineshkumar.n View Post
                how to declare the field as primary key....using roo.....
                when creating a field using roo ...then how can i declare it as primary key...
                You can define the identifier field when declaring the entity:

                entity --class ~.domain.MyClass --table MY_TABLE --identiferField code --identiferColumn CODE

                By default, Roo declares a Long "id" attribute.

                If the Roo commnad doesn't work, you can edit your java class adding the @Id anottation, creating get and set for the attirbute and letting Roo to do its job recreating the .aj files.

                There are several POSTs and some JIRA tickets regarding this issue.

                Comment

                Working...
                X