Reageding DB2 connection

Hi all,
i want to connect my java source code with DB2. I am looking in the net for the help. At one place it is written :
These JAR files are required to use the DB2 JDBC Universal driver. Put both of these JAR files in your client class path to run your application.
Please tell me how should i put the JAR file in the classpath.Thanks in advance
Ashish

public static Connection getConnection() throws SQLException
               ResourceBundle a = ResourceBundle.getBundle("db_input");
               System.out.println("Opening Connection...");
               String serverName = a.getString("SERVER_NAME");
               String user = a.getString("USER");
               String password = a.getString("PASSWORD");
               DriverManager.registerDriver(new com.ibm.db2.jcc.DB2Driver());
               Connection conn = DriverManager.getConnection(serverName, user, password);
               if(conn!=null)
                    System.out.println("Success...Database Connection is now open.");
               return conn;
Like this, server_name , user and password will be takenn from properties file ...but i am not able to figure out what should i put into server_name. for deploying i think i need to install jdbc driver and some jar files in classpath but i came to know all about this about googling. Still not confident please correct me if i am worng(which is highly probable )
-Ashish

Similar Messages

  • DB2 Connect installation for more as one application-server...

    Greetings,
    We've installed SAP 4.6D and migrated to ECC 6.0...
    also migrated from ICLI to DB2 Connect.
    We've 4 application server's on Win2k3.
    What's the perfect, with best performance - installation from DB2 Connect ?
    DB2 Connect on every appication server or on central instance server (connect-mode: server client) ?
    I'm not found tips or document's on SAP Notes (description installation procedure for <b>more as one</b> SAP application server's).
    Regards, Markus

    Hay Markus,
    You have the classic tradeoff here: like Thomas mentioned installing a DB2 connect on every server reduce latency but give you more work on an upgrade or definition change, installing just one DB2 connect is easier and more secure but have an inherent performance leg.
    I’d recommend installing on all servers with a shared parameter file or write a distribution script to distribute the file to all severs from a central location.
    Good luck,
    Uri Lifshitz.

  • ASP  db2 connection

    I'm new to ASP and experienced db2 user in C/S applications.
    I have developed a dynamiz page with Dreamweaver usin ASP
    VBscript and tried to connect db2 satabase. In defining the
    connection and preparing the record set everything went well and
    with DW I connected to dns, tested the connection and played with
    SQL everything fine. But when I tried the same thing using ASP
    page, the connection did not work and I got an error message
    showing the connection line on the program. The connections string
    seemed O.K. and the ASP program seems O.K. but application does not
    work and I get error.
    I do the same thing to Access tables everything works well,
    again with ODBC.
    Probably there is an issue with IBM DB2 connection using
    ODBC.
    Attached the connection code and the line of ASP program
    where I get error message
    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO"
    ' DesigntimeType="ADO"
    ' HTTP="false"
    ' Catalog=""
    ' Schema="DB2ADMIN"
    Dim MM_connMedbase_STRING
    MM_connMedbase_STRING =
    "dsn=MEDBASE;uid=db2admin;pwd=db2admin;"
    %>
    <%
    Dim rsMedbase
    Dim rsMedbase_numRows
    Set rsMedbase = Server.CreateObject("ADODB.Recordset")
    rsMedbase.ActiveConnection = MM_connMedbase_STRING ******here
    I get error*******
    rsMedbase.Source = "SELECT * FROM DB2ADMIN.RAND0102 ORDER BY
    RAND_TIME ASC"
    rsMedbase.CursorType = 0
    rsMedbase.CursorLocation = 2
    rsMedbase.LockType = 1
    rsMedbase.Open()
    rsMedbase_numRows = 0
    %>
    appreciate any help, thx in advance

    One thing I like about MSSQL databases is that you can manage them using Access itself. This is done by creating an Access project file with an ADP extension. It presentsna dialog for the server connection which uses the same information as the connection string. Once connected, you can manage the database the same way as you would a regular Access database in almost every aspect. You can import and export, create tables and Queries, etc. One noticeable difference is that you're presented a lot more options for datatypes for your table fields. One downside is that the web Hist must allow remote connections which some do not for security reasons. Another is that I don't know how applicable this would be in a ASP.net environment, but that's not supported by DW and even classic ASP is fading fast.  Beyond MS-based solutions is PHP with MySQL, a different animal in many respects but conceptually similar to the overall principles of dynamic websites. I still manage a small number of ASP sites, and a couple years ago decided I was overdue in choosing which technology I needed to learn. I went  the PHP route because I still wanted to use DW and many Web Assist extension which many now only support PHP. (not to say I won't ever delve into dot net, but I need to be able to hand code PHP at least to the extent that I can with VBscript)

  • Db2-connect error  - dboraslib.dll - specified module could not be found

    While I am trying to START SAP server, its giving the db2-connect error . showing the following error, can anybody throw some light.
    Thanks
    trc file: "dev_w1", trc level: 1, release: "620"
    ACTIVE TRACE LEVEL           1
    ACTIVE TRACE COMPONENTS      all, M

    B Sat Sep 30 19:06:25 2006
    B  create_con (con_name=R/3)
    B  Loading DB library 'D:\usr\sap\DWK\SYS\exe\run\dboraslib.dll' ...

    M Sat Sep 30 19:06:45 2006
    M  *** ERROR => DlLoadLib: LoadLibrary(D:\usr\sap\DWK\SYS\exe\run\dboraslib.dll) Error 126 [dlnt.c       226]
    M          Error 126 Error 126 = "The specified module could not be found."
    B  *** ERROR => Couldn't load library 'D:\usr\sap\DWK\SYS\exe\run\dboraslib.dll'
    [dbcon.c      3789]
    M  systemid   560 (PC with Windows NT)
    M  relno      6200
    M  patchlevel 0
    M  patchno    251
    M  intno      20020600
    M  pid        1580

    M  ***LOG Q0Q=> tskh_init, WPStart (Workproc 1 1580) [dpxxdisp.c   1016]
    I  MtxInit: -2 0 0

    X Sat Sep 30 19:06:46 2006
    X  EmInit: MmSetImplementation( 2 ).
    X  <ES> client 1 initializing ....
    X  Using implementation std
    M  <EsNT> Memory Reset enabled as NT default
    X  ES initialized.

    M Sat Sep 30 19:06:48 2006
    M  calling db_connect ...
    B  create_con (con_name=R/3)
    B  Loading DB library 'D:\usr\sap\DWK\SYS\exe\run\dboraslib.dll' ...
    M  *** ERROR => DlLoadLib: LoadLibrary(D:\usr\sap\DWK\SYS\exe\run\dboraslib.dll) Error 126 [dlnt.c       226]
    M          Error 126 = "The specified module could not be found."
    B  *** ERROR => Couldn't load library 'D:\usr\sap\DWK\SYS\exe\run\dboraslib.dll'
    [dbcon.c      3789]
    M  ***LOG R19=> tskh_init, db_connect ( DB-Connect 008192) [thxxhead.c   1098]
    M  in_ThErrHandle: 1
    M  *** ERROR => tskh_init: db_connect (step 1, th_errno 13, action 3, level 1) [thxxhead.c   8277]

    M  Info for wp 1

    M    stat = 4
    M    reqtype = 1
    M    act_reqtype = -1
    M    tid = -1
    M    mode = 255
    M    len = -1
    M    rq_id = -1
    M    rq_source = 255
    M    last_tid = 0
    M    last_mode = 0
    M    rfc_req = 0
    M    report = >                                        <
    M    action = 0
    M    tab_name = >                              <

    M  *****************************************************************************
    M  *
    M  *  LOCATION    SAP-Server star47e_DWK_00 on host star47e (wp 1)
    M  *  ERROR       tskh_init: db_connect
    M  *
    M  *  TIME        Sat Sep 30 19:06:48 2006
    M  *  RELEASE     620
    M  *  COMPONENT   Taskhandler
    M  *  VERSION     1
    M  *  RC          13
    M  *  MODULE      thxxhead.c
    M  *  LINE        8408
    M  *  COUNTER     1
    M  *
    M  *****************************************************************************


    M Sat Sep 30 19:06:49 2006
    M  Entering TH_CALLHOOKS
    M  ThCallHooks: call hook >SAP-Trace buffer write< for event BEFORE_DUMP
    M  ThCallHooks: call hook >ThrSaveSPAFields< for event BEFORE_DUMP
    M  *** ERROR => ThrSaveSPAFields: no valid thr_wpadm [thxxrun1.c   672]
    M  *** ERROR => ThCallHooks: event handler ThrSaveSPAFields for event BEFORE_DUMP failed [thxxtool3.c  235]
    M  Entering ThSetStatError
    M  Entering ThReadDetachMode
    M  call ThrShutDown (1)...
    B  dbtbxbuf: Buffer TBX_SINGLE not available
    M  ***LOG Q02=> wp_halt, WPStop (Workproc 1 1580) [dpnttool.c   345]

    thanks cyrus.
    I just updated the kernel and it got me passed the error but now it stops somewhere else.
    Previous error OK:
    B Library 'C:\usr\sap\DRS\SYS\exe\run\dboraslib.dll' loaded
    B Version of 'C:\usr\sap\DRS\SYS\exe\run\dboraslib.dll' is "640.00", patchlevel (0.79)
    B New connection 0 created
    M sysno 00
    M sid DRS
    M systemid 560 (PC with Windows NT)
    M relno 6400
    M patchlevel 0
    M patchno 87
    M intno 20020600
    M make: multithreaded, ASCII
    M pid 3360
    New error:
    X ES initialized.
    M
    M Mon Oct 23 16:42:37 2006
    M calling db_connect ...
    C Prepending C:\oracle\ora81 to Path.
    C got NLS_LANG='AMERICAN_AMERICA.WE8DEC' from environment
    C *** ERROR => Couldn't initialize Oracle client library,
    please check your installation!
    [dbsloci.c 1935]
    M ***LOG R19=> tskh_init, db_connect ( DB-Connect 000256) [thxxhead.c 1273]
    M in_ThErrHandle: 1
    M *** ERROR => tskh_init: db_connect (step 1, th_errno 13, action 3, level 1) [thxxhead.c 9530]
    M
    This look familiar?
    Thanks again.

  • DB2 Connection pooling

    Hi friends :
    I am writing a DB2 Connection pooling class.In oracle we set the mininmum connections like
    ocacheimpl = new OracleConnectionCacheImpl(DataSource );
    ocacheimpl.setMinLimit(minConnections)
    ocacheimpl.setMaxLimit()
    Like this is there any methods to set the min connections in the DB2.
    Please help me in this.
    Thanks
    Mandava

    Hi,
    i´ve got the same problem as Stephen.
    can anybody check my start-script, in my eyes it seems
    to be correct concerning the paths.
    thanks for urgent help
    Andreas Koch
    NetFidelity Consulting GmbH
    [email protected]
    Stephen Davies <[email protected]> wrote:
    Scott,
    is SQLLIB\bin on the path?
    Joseph Weinstein wrote:
    Hi. For 5.1, you need to edit your startWebLogic script,
    and add the DB2 driver classes to the weblogic.classpath.
    Also any native libraries needed for this driver should be
    available to the WLS process.
    Can you run a simple DB2 JDBC example program (no WebLogic code)
    in this environment?
    Joe
    scott rogan wrote:
    i'm having difficulty setting up a DB2 connection pool in WL 5.1.
    Getting this error on server startup: <E> <JDBC Pool> Failed to create
    connection pool "db2Pool"weblogic.common.ResourceException: Could not
    load 'COM.ibm.db2.jdbc.app.DB2Driver' because System.loadLibrary threw
    java.lang.UnsatisfiedLinkError with the message '[IBM][JDBC Driver]
    CLI0647E Error allocating DB2 environment handle, rc=db2jdbc.'.any
    ideas?thanks
    Stephen Davies
    Davies Consulting Pty. Ltd.
    Sydney, Australia
    Ph. +61 2 9527 4274
    [startWebLogic.sh]

  • DB2 connection in IDT

    Hi All,
    I'm on BI 4.1 SP03 and trying to create a connection to DB2 V7 using IDT. When i go to the database middleware driver section and did the following.
    * Selected DB2 for i v7
    * Entered username and password and Alias (database name)
    1. What is the Alias in the above step?
    2. Do i have to install or do any steps in the server to get the DB2 connection?
    3. I'm getting the error message in the screenshot.
    Any help is highly appreciated.
    Regards,
    DTD

    HI,
    I don't know much about DB2 but as per the IDT tutorial
    Alias - For DB2 connections, this is the alias of the database that you have created in the DB2 configuration assistant.
    Page number -94
    http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_info_design_tool_en.pdf

  • SQL0904N and SQL30081N while using DB2-Connect driver

    Scenario:
    Application program : Java on Unix
    Database : DB2 on Mainframe
    Database driver : IBM's DB2 connect
    Usage : A number of connections are taken by the program and are used as long as the program is alive
    (Life time of the program is variable. It can be as long as many days -- in a sense the program acts like a daemon process that runs as long it is not stopped).
    Scenario:
    -To one of the table using a load utility, such as BMC, data is loaded
    -Database goes to copy-pending status
    -Database is started by using the following command : "START DATABASE(database name) SPACENAM(table space name) ACCESS(FORCE)"
    Doubts:
    1. What happens to the connections that the program has opened to the database?
    2. Does the database relinquish all the resources (like the sockets it would have opened for the communication with the driver) held by it during restarting?
    (at least before restarting, it is evident that no query on the table in question is possible. A typical SQL0904N, which is non-availability of resources, is thrown)
    3. Can the above scenario cause a SQL30081N, which is resetting of connection by peer i.e. database in this case?

    Yes, there is a high probability for such things, you may want to consider using a connection pool instead of opening 2 connections once at the start of the program and using them all for days.
    Have a look at the following link to get an idea on how to implement a simple connection pool.
    http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/conpool.html

  • Upgrading db2 connect thin client from v9.1 to v9.5

    I'm looking for instructions on how to upgrade the db2 connect thin client CLI and JDBC drivers from v9.1 to v9.5 (latest fixpack). I found note 867976 describing how to update the JDBC portion. I'm wondering if there is an official way of upgrading the CLI client, now that this is normally automatically installed as part of the SAPINST process.  We want to upgrade our system from v9.1 thin client ot v9.5 thin client to use the new functionality.
    (We have instructions for upgrading from v9 Fat client to v9.5 thin client.)

    1.Copied new driver version into db2_clidriver and jdbc folders.
    2. Ran db2radm to bind new collection
    3. Used sappad to change connect.ini file back to Unix format.
    4. Restarted Cluster.
    New version working now.

  • DB2 Connect Server appear after Migrating DB2 from v8.2 to v9.5

    I migrated the database software of SAP ECC 5.0 System from DB2 v8 fixpak 17 to DB2 v9.5 fix pack 4.  After I installed the SAP DB2 licenses, I noticed that a new product "DB2 Connect Server" remained in 'Trail' status.
    Product name:                     "DB2 Connect Server"
    License type:                     "Trial"
    Expiry date:                      "01/02/2010"
    Product identifier:               "db2consv"
    Version information:              "9.5"
    I did not select this product during the installation of Enterprise Server Edition.
    Do I need to remove the product "DB2 Connect Server"?
    Is there any problem with let the product "DB2 Connect Server" expired?
    Will the following command remove the product?
    db2licm -r db2consv
    Thanks in advance!

    Dear Sameer,
    DB2 Connect Server is independent component whose purpose is to connect applications to data.
    DB2 Connect provides connectivity to mainframe and midrange databases from Linux, UNIX, and Windows based platforms. You can connect to DB2® databases on OS/390 and z/OS, iSeries, VSE, and VM. You can also connect to non-IBM databases that comply with the Distributed Relational Database Architectureu2122 (DRDA®).
    If you are not having any scenarios (in you system landscape) to use DB2 server/client Connectivity to mainframe/mid-range databases, then you can remove that product by executing db2licm -r db2consv
    If your DB2 connect Server license is already expired, and you are not able to remove it, then following workaround will be helpful.
    Workaround may be:
    1. db2stop
    2. Adjust your system clock at some point in past when this license was still trial.
    3. db2licm -r db2consv
    You can get some useful information about DB2 connect role in SAP landscape in this document[ Streamlining DB2 Connect for SAP|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/207c5c32-51ea-2a10-c7bc-bcfca74552d5&overridelayout=true].
    Regards,
    Bhavik G. Shroff

  • Need to find out a way to figure out how DB2 connect to Oracle and data mirroring etc.

    Hi, Gurus,
    I just take over a project which source is ICOMS as400 db2 database. Seems data mirro CDC is used to replicate from DB2 to oracle.
    I am very new to this datamirror CDC , plus I am new to figure out how db2 connect to oracle, is that through db link or what? or is there tnsnames entry?
    I would like anybody in this forum can point me to the right direction.
    Thanks in advance.

    user9233598, if mirroring/replication from DB2 to Oracle already exists then question is what product is being used?  If the product has already been purchased then I do not think it is very likely that management is going to want to purchase another product so I do not see how extra-cost Golden Gate or other Oracle Gateway features apply if those are not currently in use.  If Golden Gate or the Oracle Transparent Gateway are in use then you already have your answer
    Oracle supports ODBC/JODBC and the replication application on the AS400 likely uses these features or a thick Oracle client as the interface to Oracle.
    HTH -- Mark D Powell --

  • DB2 Connection Problem - Can't find - COM.ibm.db2.jdbc.app.DB2Driver

    Hi All,
    when executing an application and attempting to connect to DB2 I get;
    error java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver
    I've added the 'db2java.zip' library to the java.conf file (and the native db2 libs) and can make db2 connections using the database connect via the IDE. But not when executing my application - what am I missing.
    TIA
    Bill

    Hi Deepak,
    I added the db2java.zip to the
    project properties/libraries/classpath
    and it works fine. (well my code fails - but that's another problem <g>.)
    Thanks for all your help.
    Bill

  • DB2 Connection/Command hangs

    Hello there,
    I changed teh LOCKTIMEOUT parameter
    db2 deactivate db DEV
    db2 "update db cfg for DEV using LOCKTIMEOUT -1"
    db2 activate db DEV
    As soon as issued 3rd command: db2 activate db DEV
    This command start hanging, and after waiting long time i tried to kill the db2 processing using db2_kill and re-start the database via dbstart, then i try to connect to the database: db2 connect to DEV...and it hangs
    Any db2 command I issue it jsut hangs.
    I tried R3trans -x, this one also hangs.
    I just realized that I do not need to deactivate database to changed the DB parameters.
    Please help me to troubleshoot this issue.
    Thanks
    Kumar
    Edited by: Kumar Subramaniam on Jun 27, 2010 1:20 AM

    Hello Kumar,
    If you run a db2 get applications snapshot show details
    this also hangs?
    please logon as db2<db2sid> to Database Server and issue  
    1. db2 get snapshot for applications on <DBSID>           
    2. db2 get snapshot for db on <DBSID>                     
    3. db2pd -everything                                      
    If one of these works it will help track down exactly what the db was doing when it hanged.
    Regards,
    Paul

  • Which edition of DB2 Connect neccessary for connection with WebLogic 6.1

    Hi!
    Who can tell me, which editions of DB2 Connect work together with WebLogic
    6.1?
    - the hardware-related Personal Edition
    - the Enterprise Edition run on an extra server, which works as a gateway
    between DB2 and its clients.
    - the CAE-Client (Client Application Enabler)
    We would prefer the Personal Edition - if possible - does anyone has
    experiences? IBM can not give us this neccessary information.
    Thanks
    Marita

    Hi Marita,
    WebLogic will work with any JDBC 2.0 compatible driver.
    Generally, a gateway would add some overhead. You could
    setup a WebLogic connection pool using the simplest way
    and see if it satisfy your needs.
    Regards,
    Slava Imeshev
    "Marita León Ohl" <[email protected]> wrote in message
    news:[email protected]..
    Hi!
    Who can tell me, which editions of DB2 Connect work together with WebLogic
    6.1?
    - the hardware-related Personal Edition
    - the Enterprise Edition run on an extra server, which works as a gateway
    between DB2 and its clients.
    - the CAE-Client (Client Application Enabler)
    We would prefer the Personal Edition - if possible - does anyone has
    experiences? IBM can not give us this neccessary information.
    Thanks
    Marita

  • Configuring DB2 connect for Bussiness Objects  XI on Unix server

    Hello,
    We have installed DB2 Connect on the same unix server where BO is running.
    We are trying to connect BO to DB2 on the Mainframe.
    We are able to connect from the db2 prompt on the Unix to the DB2 on Mainframe.
    We created the instance, and LD_LIBRARY PATH, CLASSSPATH, PATH, DB2INSTANCE Env. vars. are also pointing to the right location.
    Do I need perform additional setup(s) for the BO, for it to connect to the DB2?
    Anyone know?
    Thanks in advance.
    -Shaista

    I recommend that you check out the IBM Pattern book from the support site.  You can do a search at support.businessobjects.com for 'Setup DB2 XIR2' if the link below doesn't work.
    http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=patternbookIBM03192008pdf&sliceId=&dialogID=20064845&stateId=1%200%2020066363
    As part of the setup, the instructions recommend sourcing a db2profile from the boe user's .profile.  It also has some information on testing the connectivity to the database, and minimum patch requirements.
    HTH.

  • DB2 Connect or Data Server Drivers

    Can we use anything other than DB2 connect such as Data Server Drivers from IBM to be able to connect to the databases on mainframe?

    HI,
    check the available PAM guide for the same.
    This should help you to check, whether other options are supported
    Regards,
    Atul B

Maybe you are looking for

  • Events in a Tab

    Dear all, I want to write a Tab program, when I change Tab page, the while loop in this page will run,  other pages will stop running. It works fine. However, when I add an event to Tab page1, I can only change Tab page once, after that, my program d

  • HP Officejet Pro 8620 (Wireless Network) will not install on Win8. 1

    Today I received my new HP Officejet 8620 PRO printer. I have setup Wireless Network access, and installed the Driver successfully on my Windows 7 Ultimate 64 Bit PC, and tried to do the same on my Acer Win8.1 Laptop. During the installation, it find

  • TS2972 My Apple TV 3 can not set time network, since one week from now, before was working perfectly

    My Apple TV 3 just stop working, it can not set the time network I have call for support and done everything as requested and still nothing, can somebody help me with This it has pass a week and nothing yet. I even restored as support toll me too, no

  • How do I delete the message app from my mac?

    I have a late 2009 iMac 21.5" monitor. I noticed when I upgraded the operating system, Messages was added. I don't like having messages appear on the iMac. I've tried to disable messages, by removing all associated accounts.  eg. phone, email. etc, H

  • Restore Exchange 2010 Database into Restore Database in stages

    I have a full backup and a number of incremental backed up using TSM. I am trying to restore a database into a recovery DB so that I can mount an old version of a users mailbox. To restore the full backup and all the subsequent incremental backups up