facebook

MyEclipse 4.1: an’t connect to MVS DB2 In DataBase Explorer

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts
  • #246262 Reply

    Steve Gutter
    Member

    – System Setup ——————————-
    Operating System and version:
    Eclipse version: 3.1.0
    Eclipse build id: I20050627-1435
    Fresh Eclipse install (y/n): Y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins:
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*:
    MyEclipse version: 4.1.0 GA
    Eclipse JDK version:
    Application Server JDK version:
    Are there any exceptions in the Eclipse log file? no

    If this is a DB related question please answer the following:

    RDBMS vendor and version:
    JDBC driver vendor and version, and access type (thin, type-2, etc):
    Connection URL: jdbc:db2:myAlias
    Eclipse error logs related to com.genuitec.eclipse.sqlexplorer packages:

    – Message Body ——————————-
    I am receiving an error trying to connect to an MVS DB2 DB in the
    Database Explorer in Eclipse 3.1.0 / MyEclipse 4.1.0 GA.
    I am using the same jar and driver that works in Eclipse 3.0 / MyEclipse 3.8.3.
    jar name: db2java.jar
    driver name: COM.ibm.db2.jdbc.app.DB2Driver

    When I try to create my own Driver definition using this jar and driver name, I get the error message:
    Cannot instantiate driver, given class name is not a valid JDBC driver.

    #246269 Reply

    Haris Peco
    Member

    you grab another driver from anywhere, maybe
    check double drivers jdbc or
    try simple application from thread http://myeclipseide.com/PNphpBB2+file-viewtopic-t-11228.html
    (message from snpe)

    #246290 Reply

    Brian Fernandes
    Moderator

    etienneg,

    Another reason is becuase all the DLLs for the type 2 driver are no longer accessable. Did you change your system configuration in some way?

    Could you try using the type 4 driver instead, you can download it from here: DB2 Type 4

    That will also eliminate future issues you might face with the type 2 driver and reverse engineering (Hibernate).

    Let us know if you require further assistance,
    Best,
    Brian.

    #246308 Reply

    Steve Gutter
    Member

    I downloaded the jar you pointed to (db2jcc.jar from db2_jdbc_t4.zip).
    When I try to add driver COM.ibm.db2.jdbc.app.DB2Driver
    from there, I get the message:
    Error Adding Driver: java.lang.UnsatisfiedLinkError: Native library
    C:\Program Files\SQLLIB\bin\db2jdbc.dll already loaded in another class loader.

    #246313 Reply

    Brian Fernandes
    Moderator

    etienneg,

    1) Make sure you remove all existing JARs from your driver setup, then only add the db2cc.jar file from the zip you downloaded.
    2) Use this driver instead of the app driver you specified: com.ibm.db2.jcc.DB2Driver

    Hope this gets you going,
    Best,
    Brian.

    #246318 Reply

    Haris Peco
    Member

    Etienneg,
    add db2jcc_license_cu.jar and db2jcc.jar and class like Brian tell you

    However, i think that you grab old type 2 driver (native libraries doesn’t exists in type 4 drivers) – check your connection double.

    Thanks

    #246362 Reply

    Steve Gutter
    Member

    I tried the suggested changes, but keep getting the message:
    Failure in loading T2 native library db2jcct2.
    Do I need a T4 MVS DB2 driver?
    If so, how do I get it?
    I’ve seen other posts which sound like yes, this worked in MyEclipse 3.8, but it doesn;t work yet and hasn’t been fixed in MyEclipse 4.1. Is that true?

    #246363 Reply

    Haris Peco
    Member

    Etienneg,

    MyEclipse 4.1 work fine with db2, but you have to use type4 driver.
    add driver’s jars in classpath (both from my previous post), set driver class
    to com.ibm.db2.jcc.DB2Driver (MyEclipse add this for you if you add correct class
    and choose db2 driver) and URL from your DBA

    remove previous jars when you define driver (or remove old db2 configuration complete
    – you call type 2 driver – this driver isn’t work with MyEclipse (for now)

    type 4 drivers haven’t native libraries – ti is pure java driver
    if you got error ‘native library’ when you load old driver
    – check with little application (ulr from previosu page) that test connection

    best

    #246364 Reply

    Brian Fernandes
    Moderator

    Etienneg,

    Please let us know what connect string you are using; also is your database on the local machine or remote?
    Apparently the same driver class will either resort to using a type 2 or type 4 based connections strategy based on the URL you specify.

    A type 4 URL looks something like this: jdbc:db2://server:port/dbname

    Could you try that with the same driver and see if it works?

    Best,
    Brian.

    #246408 Reply

    Steve Gutter
    Member

    I’m not trying to do this via an application: I’m trying to do this via MyEclipse’s DataBase Explorer perspective. None of the suggestions, while greatly appreciated, have worked. Do you have a working example of connecting to MVS DB2 via MyEclipse V4.1 GA using the DataBase Explorer perspective?

    #246411 Reply

    Brian Fernandes
    Moderator

    Sure, we have tested MyEclipse 4.1GA with both type 2 AND type 4 drivers for DB2.

    I know you aren’t talking about an application either, I am talking about the URL used in the connection profile MyEclipse uses to connect to the database.

    Depending on the URL used there, a type 2 or type 4 connection will be used.

    Let us know if you need further clarification.

    Best,
    Brian.

    #246514 Reply

    Steve Gutter
    Member

    I didn’t mean to doubt that you had tested it.
    Sorry if I gave that impression.
    But something has changed: it works fine in MyEclipse 3.8 using a driver I defined as:
    Driver: COM.ibm.db2.jdbc.app.DB2Driver
    from extra class path: db2java.jar
    URL: jdbc:db2:DB20TCP
    (DB20TCP is the alias for the DB as defined in my PC’s IBM DB2 Client Configuration Assistant).

    When I try it in MyEclipse 4.1 using a driver I defined the same way, it doesn’t work.
    I can’t even define the driver!
    It gives me the message: Cannot instntiate driver, given driver class name is not a valid JDBC driver.
    Is there maybe some file I have to add to an Eclipse or MyEclipse directory?
    This might be the problem: what should I select for Driver Template?
    That’s a new attribute that wasn’t in MyEclipse 3.8’s DataBase Explorer ‘add your own driver’.

    #246516 Reply

    Brian Fernandes
    Moderator

    etienneg,

    The problem most likely is that you already have a driver defined in MyEclipse which uses the jar you specified. This would cause the UnsatisifedLinkerException you mentioned above.

    The following options are available to resolve this issue:
    a) Look at the drivers you aready have defined, do any of them use the same jar? If so, remove the driver. Shutdown eclipse. Restart eclipse and configure a new driver. (The shutdown, restart sequence is important)
    b) Start eclipse in a new workspace. (We can return to your earlier workspace once the cause of this issue is determined). Start eclipse with a -data parameter. Something like c:\eclipse\eclipse.exe -data c:\MyNewWorkspace
    Proceed to configure your driver in that workspace.

    If you read my earlier posts, I was trying to point you in the direction of using a Type 4 driver. The above technique is for Type 2. Type 4 drivers are generally much easier to work with, provided your version of DB2 supports it.
    I think you have misunderstood my previous instructions, so this possibility hasn’t been tried out yet.
    1) Unzip the zip I pointed you to earlier. DB2 Type 4
    2) Add all the JAR files in the zip to a NEW driver configuration
    3) The driver class name should be com.ibm.db2.jcc.DB2Driver, do not use COM.ibm.db2.jdbc.app.DB2Driver
    4) For the connection URL in the profile, use something like jdbc:db2//localhost:<port>/<dbname>. Do not use jdbc:db2:DB20TCP as the URL since that will resort to using a type 2 connection. (It is the same driver, but the connection URL determines the type of connection).

    Fundamentally, 3.8.x and 4.1 are the same, all that has changed is the UI and some error checking mechanisms.

    Please let me know if you have further issues, I’d like to see you get this working too.

    Best,
    Brian.

    #246765 Reply

    Steve Gutter
    Member

    I’m using the driver you specified (com.ibm.db2.jcc.DB2Driver) from the file you indicated
    (db2cc.jar), and filling in the URL with the same values I use to access the DB via the IBM DB2 client package’s Client Configuration Assistant. I’m getting the error message ‘Unable to create connection: check your URL’. In the URL, I’m using:
    jdbc:db2//u957dbc9.atlas.com:52012/ALPHADB1
    In the IBM DB2 product, which I can access the DB with, I have entries which match those values in the URL:
    protocol = TCP/IP
    host name = u957dbc9.atlas.com
    port number = 52012
    alias = ALPHADB1
    So, I guess its close, but I don’t see what’s wrong with the URL.
    But, also, if fundamentally 3.8 and 4.1 are the same, then why isn’t the Driver setup I’m using in 3.8 working in 4.1?

    #246767 Reply

    Haris Peco
    Member

    etienneg,

    Do you add db2jcc_license_cu.jar , too ?
    Can you send complete log (Error log view form PDE Runtime category), please ?

    Best

Viewing 15 posts - 1 through 15 (of 33 total)
Reply To: MyEclipse 4.1: an’t connect to MVS DB2 In DataBase Explorer

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