Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2003
    Location
    BeiJing
    Posts
    4

    Unanswered: Db2 and JSP ,help!

    i have a remote DB2 database.
    I am using beans for connecting and fetching data from it in my JSP pages.
    my words in bean is as that:

    sDBDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
    sSqlErrState = new String();
    sConnStr = "jdbc:db2:mydb";

    but i can't connect the remote database

    the error is :
    java.sql.SQLException: No suitable driver
    In execquery connection is null

    in fact ,when i use sqlserver 2000 ,the jsp page can run right.

    So ,is some one can heilp me ?
    Thanxs in advance.

  2. #2
    Join Date
    Jul 2003
    Location
    China
    Posts
    9

    Re: Db2 and JSP ,help!

    maybe you can use "COM.ibm.db2.jdbc.net.DB2Driver"
    instead of "COM.ibm.db2.jdbc.app.DB2Driver"

    moreover,you mean it's a remote database
    shouldn't the sConnstr include the IP of the remote server?


    Here is the description of the db2 connection I'm using,I want it helpful


    <driverName>COM.ibm.db2.jdbc.net.DB2Driver</driverName>
    <targetDatabase>DB2</targetDatabase>
    <dataSourceName>jdbc:db2://192.168.66.16:6789/sxfm</dataSourceName>
    <password>sxfm</password>
    <userName>sxfm</userName>

    Originally posted by mu_mu
    i have a remote DB2 database.
    I am using beans for connecting and fetching data from it in my JSP pages.
    my words in bean is as that:

    sDBDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
    sSqlErrState = new String();
    sConnStr = "jdbc:db2:mydb";

    but i can't connect the remote database

    the error is :
    java.sql.SQLException: No suitable driver
    In execquery connection is null

    in fact ,when i use sqlserver 2000 ,the jsp page can run right.

    So ,is some one can heilp me ?
    Thanxs in advance.

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

    Re: Db2 and JSP ,help!

    Have you installed a client (Runtime or admin or app dev) on your client ?

    Please do not use the type 3 (net) driver .... The support for this type of driver will be withdrawn in some future release ... Instead go for type 4 ..
    Cheers
    Sathyaram


    Originally posted by mu_mu
    i have a remote DB2 database.
    I am using beans for connecting and fetching data from it in my JSP pages.
    my words in bean is as that:

    sDBDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
    sSqlErrState = new String();
    sConnStr = "jdbc:db2:mydb";

    but i can't connect the remote database

    the error is :
    java.sql.SQLException: No suitable driver
    In execquery connection is null

    in fact ,when i use sqlserver 2000 ,the jsp page can run right.

    So ,is some one can heilp me ?
    Thanxs in advance.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  4. #4
    Join Date
    Apr 2003
    Location
    BeiJing
    Posts
    4
    thank you ,rijkaard
    i have tried as you say.but it does't work rightly.

    And thank you,sathyaram_s
    i have installed a DB2 client on my computer

    thank you two for your advice
    i will try until i find the reason

  5. #5
    Join Date
    Apr 2003
    Location
    BeiJing
    Posts
    4

    Exclamation

    if i installed WebSphere on the remote server with DB2 server.
    they will work right.

    if ii installed Tomcat on my computer and use the local SQL server2000,No error occur.

    if i installed Tomcat on my computer and use the remote DB2 server,
    error will occur.

    Why?

  6. #6
    Join Date
    Jan 2002
    Location
    USA
    Posts
    53
    You should put DB2Driver into Tomcat directory (some speicial directory). I have same problem two moths age.
    It should be /tomcat/.../COM/ibm/db2/jdbc/app/DB2Driver

    WTH.



    ljrong

Posting Permissions

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