How to check the database existence using java.

Hi All,
I need to know if a database exists or not using DB2 sql statements. Is there any sql to find that.
Thanks in advance

try to connect to the database. if it is possible, the database exists - if not - well there may be a number of reasons, but if your database URL is correct, your network is ok and your database engine is running, the database is not existent.

Similar Messages

  • How to check the database connection using OCI

    I am working on enhhancement of very old application developed using C and OCI. It has a background process which acts as a middleware for interaction of any other front end process with oracle database. Any processes, which needs to interact with database sends a request to background peocess and then it will execute a call to execute the stored procedures for performing requested operation (like select, update, insert) on table and will send the result back to respective process. So this process has to be always running in background and connected to branch database.
    If branch database gets restarted or connection gets dropped due to some ad-hoc problem then the background process also has to be restarted manually. Because this process establishes the connection to branch database only once on start up and it does not have the intelligence to reconnect automatically in such scenario.
    I am looking forward to build the intelligence in this process to automatically reconnect if connection with branch database is lost. But I am not familer with OCI, and I am not sure if there is any OCI call which can determine if my earlier connection is still available. Can any one please tell me if there is any other way to check the connection other than the execution of dummy query, then check if it gets executed properly and then do the actual query.
    Thanks in advance,
    Deeapk

    Hi,
    If you are reworking the application can you not build in the functionality to re-establish a connection if there is a failure? That is, a submission from the application server to the database server detects a failure, etc. and then re-establishes the connection. If you need a more frequent check than during a user-initiated roundtrip, you may be best served by using the "dummy query" technique on some time interval.
    From my understanding using HA Event Notification would require a RAC database (plus a multi-threaded application and services correctly configured on the RAC-side).
    In the documentation I see this:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci09adv.htm#sthref1495
    "Applications must connect to a RAC instance to enable HA event notification."
    In any case, this has the potential to be a bit complicated...
    Regards,
    Mark

  • In ecatt - how to check at database level using ABAP

    Hi,
    How to check at database level using ABAP in Ecatt tool.
    say,for example I want to check a particular sales order is invoiced or not ,at the database level and if it is invoiced I have stop proceeding to invoicing of that sales order number.
    Could anybody suggest on this with an example?
    thanks.

    Hi,
    you can use the command GETTAB to access single db records.
    Full specified or partitial specified keys can be use at GETTAB. It will return always only one record, also if a couple could match your selection.
    For more advanced scenarios you can also use eCATTs Inline ABAP. In a block between the commands ABAP. ENDABAP. you can code ABAP statements, e.g. SELECT ... INTO TABLE ...
    eCATT script parameters of type 'V' defined in that script using ABAP/ENDABAP will be transfered into the ABAP block and back to script after ABAP perform.
    Best regards
    Jens

  • How to check & unzip zip file using java

    Dear friends
    How to check & unzip zip file using java, I have some files which are pkzip or some other zip I want to find out the type of ZIp & then I want to unzip these files, pls guide me
    thanks

    How to check & unzip zip file using java, I have
    ve some files which are pkzip or some other zip I
    want to find out the type of ZIp & then I want to
    unzip these files, pls guide meWhat do you mean "other zip"? Either they're zip archives or not, there are no different types.

  • How to get the context data using java script in interactive forms

    Hi All,
    How to get the context data using java script in interactive forms by adobe,  am using web dynpro java
    thanks.

    Hi venkat,
    Please Refer this link.
      Populating one Drop-Down list from the selection of another Drop-down list
    Thanks,
    Raju.

  • How to import the image by using java application

    1.how to import the image by using java APPLICATION and display it on the textarea that you have been created.
    2.how to store the image into the file.
    3. what class should i used?
    4. how to create an object to keep track the image in java application.
    * important : not java applet.
    plzzzzzzz.
    regards fenny

    follow the link:
    http://java.sun.com/docs/books/tutorial/2d/images/index.html

  • How to check the user is using mobile to browse my website??

    Dear all,
    i am new in Java.Pls help!!i want to check the user is use what tools to browse my website...i mean if the user is using mobile to vist my website(eg:http://www.abc.com), it will rediect the mobile user to a webpage only for mobile user,otherwise,it will redirect to normal page for normal user(use browser such as ie,netscape)...
    how to do it? which function did i use?please give me some tips!!!
    Java baby , Frankie

    Check the User-Agent header of your request. Most phones will identify themselves through it.

  • How to connect the database (JDBC) using service name rather than SID

    How should we make the connection to the database using service name. Initially, we are using the SID to make the database connection, with following setting in the data-source.xml in OC4J using ABCDB as the SID.
    <data-sources>
         <data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="jdbc/ABCDB"
              location="jdbc/ABCDB"
              pooled-location="jdbc/OracleDSPooled"
              xa-location="jdbc/xa/OracleDSXA"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="ABC"
              password="ABC"
              url="jdbc:oracle:thin:@191.1.4.126:1521:ABCDB"
         />
    </data-sources>
    It work, but now we need to make the connection using this service name ABCSERVICE, but it doesn't work in the OC4J (JDBC). May I know how should we handle this connection?
    Thanks and Regards,
    Pang

    Finally, I got the solution to make the database connection using service name, with putting the tnsname setting in URL portion.
    url="jdbc:oracle:thin:@(description=(address=(host=191.1.4.126)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME = ABCSERVICE)))"
    And now, it is working fine.
    Regards,
    Pang

  • How to check the material consumption using tables

    Hi,
    I would like to know how to generate or view the material consumption at table level. Can anyone please specify the transactions codes and tables names how to check the consumption of material. I also like to know how to analysis the consumption of material between components and finished material. Please provide me the step by step wise how to do.Thanking you
    Regards,
    Sivaji Kumar Madhu Kiran

    You can calculate material consumption in table MSEG. you will need to segregate the material documents based on movement types and then add or reduce the quantities of each material document. for example a material document with movement 101, add the quantity for the material, and when there is a issue material document like 201 or 221 reduce the quantity from the material stock.

  • How to check the output of a java card program ?

    Hi,
    I am new to java card technology.I am trying to run a simple helloworld program given in the java development kit2.2 -windows samples in eclipse3.5.
    For running I followed the following steps:-
    1) Firstly,I went to JCWDE->start
    2) then on Project->java tools->deploy
    It shows me following output :-
    Java Card 2.2.2 APDU Tool, Version 1.3
    Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    Opening connection to localhost on port 9025.
    Connected.
    Received ATR = 0x3b 0xf0 0x11 0x00 0xff 0x00
    CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 08, 01, Le: 00, SW1: 90, SW2: 00
    CLA: 80, INS: b0, P1: 00, P2: 00, Lc: 00, Le: 00, SW1: 90, SW2: 00
    CLA: 80, INS: b2, P1: 01, P2: 00, Lc: 00, Le: 00, SW1: 90, SW2: 00
    CLA: 80, INS: b4, P1: 01, P2: 00, Lc: 18, 01, 00, 15, de, ca, ff, ed, 01, 02, 04, 00, 01, 0b, 01, 02, 03, 04, 05, 06, 07, 08, 09, 00, 01, Le: 00, SW1: 64, SW2: 3a
    CLA: 80, INS: bc, P1: 01, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b2, P1: 02, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 02, P2: 00, Lc: 20, 02, 00, 1f, 00, 15, 00, 1f, 00, 0f, 00, 15, 00, 36, 00, 0c, 00, 69, 00, 0a, 00, 14, 00, 00, 00, 6c, 00, 00, 00, 00, 00, 00, 02, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 02, P2: 00, Lc: 02, 01, 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: bc, P1: 02, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b2, P1: 04, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 04, P2: 00, Lc: 18, 04, 00, 15, 02, 03, 01, 07, a0, 00, 00, 00, 62, 01, 01, 00, 01, 07, a0, 00, 00, 00, 62, 00, 01, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: bc, P1: 04, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b2, P1: 03, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 03, P2: 00, Lc: 12, 03, 00, 0f, 01, 0b, 01, 02, 03, 04, 05, 06, 07, 08, 09, 00, 00, 00, 14, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: bc, P1: 03, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b2, P1: 06, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 06, P2: 00, Lc: 0f, 06, 00, 0c, 00, 80, 03, 01, 00, 01, 07, 01, 00, 00, 00, 21, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: bc, P1: 06, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b2, P1: 07, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 07, 00, 69, 00, 02, 10, 18, 8c, 00, 01, 18, 11, 01, 00, 90, 0b, 87, 00, 18, 8b, 00, 02, 7a, 02, 30, 8f, 00, 03, 3d, 8c, 00, 04, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 8b, 00, 02, 7a, 05, 23, 19, 8b, 00, 05, 2d, 19, 8b, 00, 06, 32, 03, 29, 04, 70, 19, 1a, 08, ad, 00, 16, 04, 1f, 8d, 00, 0b, 3b, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 16, 04, 1f, 41, 29, 04, 19, 08, 8b, 00, 0c, 32, 1f, 64, e8, 19, 8b, 00, 07, 3b, 19, 16, 04, 08, 41, 8b, 00, 08, 19, 03, 08, 8b, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 0c, 00, 09, 19, ad, 00, 03, 16, 04, 8b, 00, 0a, 7a, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: bc, P1: 07, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b2, P1: 08, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 08, P2: 00, Lc: 0d, 08, 00, 0a, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: bc, P1: 08, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b2, P1: 05, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 05, P2: 00, Lc: 20, 05, 00, 36, 00, 0d, 02, 00, 00, 00, 06, 80, 03, 00, 03, 80, 03, 01, 01, 00, 00, 00, 06, 00, 00, 01, 03, 80, 0a, 01, 03, 80, 0a, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 05, P2: 00, Lc: 19, 06, 03, 80, 0a, 07, 03, 80, 0a, 09, 03, 80, 0a, 04, 03, 80, 0a, 05, 06, 80, 10, 02, 03, 80, 0a, 03, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: bc, P1: 05, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b2, P1: 09, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: b4, P1: 09, P2: 00, Lc: 17, 09, 00, 14, 00, 03, 0e, 27, 2c, 00, 0d, 05, 0c, 06, 04, 03, 07, 05, 10, 0c, 08, 09, 06, 09, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: bc, P1: 09, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    CLA: 80, INS: ba, P1: 00, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
    Can anyone tell me what is this output? And Am i deplyoing in the right way?

    Hi,
    You might want to check the JCDK user guide (cJDK_Users_Guide_bin_do.pdf) for details of using an emulated card environment. It outlines how to use the simulators provided with the JCDK. This should tell you how the deploy process works and will give you some insight into what this script is doing.
    Cheers,
    Shane

  • How to disconnect the database connection using crystal report

    Post Author: cp_pramodu
    CA Forum: Crystal Reports
    Hi All,
    We have developed an application using .Net and Crystal Reports 10 for generating Adhoc reports from Business system (db sybase 12). We are using the below mentioned script for opening rpt files.
    Try
           ReportDocument1.Load(sReportName)
           For Each table In ReportDocument1.Database.Tables
                  ' Get the TableLogOnInfo object.
                  logonInfo = table.LogOnInfo
                  ' Set the server or ODBC data source name, database name,
                  ' user ID, and password.
                  logonInfo.ConnectionInfo.ServerName = sReportServerName
                  logonInfo.ConnectionInfo.DatabaseName = DBName
                  logonInfo.ConnectionInfo.UserID = UserName
                  logonInfo.ConnectionInfo.Password = Password
                  ' Apply the connection information to the table.
                 table.ApplyLogOnInfo(logonInfo)
    Next
    'Me.Cursor = Cursors.WaitCursor
    Me.CrystalReportViewer1.ReportSource = ReportDocument1
    'Me.Cursor = Cursors.Default
    Catch ex As Exception
    'Response.Write(ex.Message)
    Finally
    Me.Cursor = Cursors.Default
    'ReportDocument1.Close()
    'ReportDocument1.Dispose()
    End Try
    Each time user opens the report a new connection is established to the database, can we disconnect the connection established from crystal reports, while closing crystal report. At the same time i want to setup an Idle time for these connections. In database level, i will not be able to set idle time in database level, as it affect our electronic channels.
    Waiting for a reply.
    Thanks & Regards,
    Pramodu. C. P

    Hi,
    If you are reworking the application can you not build in the functionality to re-establish a connection if there is a failure? That is, a submission from the application server to the database server detects a failure, etc. and then re-establishes the connection. If you need a more frequent check than during a user-initiated roundtrip, you may be best served by using the "dummy query" technique on some time interval.
    From my understanding using HA Event Notification would require a RAC database (plus a multi-threaded application and services correctly configured on the RAC-side).
    In the documentation I see this:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci09adv.htm#sthref1495
    "Applications must connect to a RAC instance to enable HA event notification."
    In any case, this has the potential to be a bit complicated...
    Regards,
    Mark

  • How to upload the file without using java components?

    Hello,
    I need to upload the file using JSP, but I don't want to use java componets(such as
    jspsmart).
    Who can tell me how to realize it? This issue is very important to me,
    thanks all in advance!

    make you're own servlet using the multipartrequest from o'reilly.
    easy and simple, no jspsmart, only 1 jar file and some descent programming.
    I use it like that...

  • How to check the customer class using CRM_PRICING_BADI...

    Hello Experts,
    I am using the said BADI in transaction CRMD_ORDER to check the
    customer class and condition exclusion. What data do I need to use and pass?
    Sorry since I am fairly new to CRM module.Hope you can help me guys.Thank you and take care!

    No answer...

  • How to check the database is running in which normalization

    All,
    I wanted to know in which normal form(1NF,2NF,BCNF) my database is working. How to find that...Suggestions Please .

    Tippu, I will agree with pretty much everything that the other posters have already posted.
    Related to the concept of normalization, in the database would be the definitions of primary key (PK), unique key (UK), and foreign key (FK) constainsts within the database. Looking at the constaints definded in the database by querying the rdbms dictionary view DBA_CONSTRAINTS might be of interest for trying to identify and understand the relationship between tables in your applications. However, there is no database requirement that these relationships be defined within the database.
    That is instead of declaring a PK on tableA there might just be a unique index and no FK to the header table, tableA, from its child detail table, tableB, declared in the database in this case. It would be totally up to the application to enforce this relationship. Still the view will provide information if most of the table relationships are formally defined in the database or not.
    HTH -- Mark D Powell --

  • How to know the system configuration using Java.

    Hello Everyone,
    I wanna know the system configuration (Hard Disk size,Ram capacity,Processor speed) .Can we know it using Java API? Or else is there any API which makes my life easier?
    Can someone let me know,please?
    All ur answers r most welcome.
    Thanks

    --> provides you with some basic info on os user and os but my best bet is to find a windows system file that maintains this information and then read the data from it
    import com.sun.servicetag.SystemEnvironment;
    SystemEnvironment se = SystemEnvironment.getSystemEnvironment();
            System.out.println(se.getCpuManufacturer());
            System.out.println(se.getHostId());
            System.out.println(se.getHostname());
            System.out.println(se.getOsArchitecture());
            System.out.println(se.getOsName());
            System.out.println(se.getOsVersion());
            System.out.println(se.getSerialNumber());
            System.out.println(se.getSystemModel());
            System.out.println(se.getSystemManufacturer());Edited by: emmanuel.putti on Nov 11, 2008 6:43 AM

Maybe you are looking for

  • Is there a way of rotating clips in FC4?

    I have a plug in for iMovie that does the job, but would prefer to do it directly from FC, rather then transferring clips back and forth. Any suggestions, please? Thanks.

  • Purchase Order Response workflow.

    Hi Masters of SRM.     My scenario is MM-SUS  version 5.0  the request is started a  Workflow maybe new or standar, in POR confirmation by Vendor when Response has  variance in qty or delivery dates.  I know exist a wf standar but in scenario SRM-SUS

  • Validating delete operation

    Hello, I need to validate an entity remove operation and prevent it to be removed in some conditions. In developer's guide, i saw something like this: *"Before an entity row is removed, the remove() method is invoked on an entity row.* *You can throw

  • Link inside a tabbed panel

    Hi, I am working on odc:tabbedPanel in JSF. I have four tabs in it. In one of the tabs, I have links in the second tab which need to href to other pages and should be shown in the same tab. But it gets refreshed and comes to the first tab. Can anyone

  • Remote Monitoring at AW

    Hi All, Remote Silent Monitoring requires a separate Server for the UCCE Solution, Can we deploy Remote Silent monitoting Suite on AW Server or we need a dedicated servert for Remote Silent Monitoring. AW is our separate Server, we are using Rogger a