Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2003
    Posts
    2

    Unhappy Unanswered: Just can't load driver correctly from a servlet - no suitable driver

    Setup:

    Red Hat 9 - DB2 Connect successfully installed and working
    (after much pain). 'db2' from the command line working; can
    connect and do queries to a mainframe database.
    Driver loaded usual way ie .
    Class.forName ("COM.ibm.db2.jdbc.app.DB2Driver)
    then to get connection DriverManager.getConnection(....)
    Works fine in a standalone Java program.

    From a servlet (using Tomcat) on the first invocation I get
    UnsatisfiedLinkError - can't find db2jdc (which of course is the native library). Subsequently, just get the 'No Suitable Driver' exception.

    I think this message may be misleading because if I do
    System.loadLibrary("db2jdbc") in the servlet it loads fine.

    java.library.path looks good, ie has /home/db2inst/sqllib/lib

    I verified that DB2INSTANCE is passed in the catalina.sh script
    (and I can read the property in the servlet).

    Also tried sourcing 'db2profile' from /etc/profile and /etc/bashrc.
    Even though DB2 Connect may not officially be supported on RH9
    I think because it works in a standalone Java program, it should also
    work in a servlet.

    Any ideas would be greatly welcome !!

    Thanks
    Suki Purewal

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Just can't load driver correctly from a servlet - no suitable driver

    AFAIK, DB2 is not yet supported on RH 9 ....

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    The reason DB2 is not supported on RH9 is that there are java problems with the new POSIX libraries.

    There are workarounds for DB2 server that may work for DB2 Connect, but beware that it may disable multi-processor support. Check out this thread:

    http://dbforums.com/showthread.php?threadid=789822

    Reports are that it may be fixed in FP4 (FP2 is the current FixPak).

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    But Marcus, are you aware of IBM supporting this officially ?

    Cheers

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Absolutely not. If one has any problems while running on RH9, IBM will not help you. But I got DB2 server to work on RH9 on my home machine with those workarounds. Of course, I don't have an IBM support contract.

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: Just can't load driver correctly from a servlet - no suitable driver

    Originally posted by suki
    Setup:
    Class.forName ("COM.ibm.db2.jdbc.app.DB2Driver)
    I'd try using .net. driver instead of .app. You're not running DB2 on the same box with Tomcat, are you? :-)

    Nick
    ---
    "It does not work" is not a valid problem statement.

  7. #7
    Join Date
    Jul 2003
    Posts
    2
    I was hoping someone may have been able load the driver
    and connect from a servlet (using Tomcat) on RH9.

    I am connecting fine from a standalone java program.
    Don't even need to set LD_ASSUME_KERNEL to get
    around any problems specific RH9.

    May be I'll post to some Tomcat newsgroup.

    Thanks
    Suki Purewal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •