JDBC connection string from POJOs

I have created a new connection named ConnDB. It was added in Application Resources/Descriptions in file connections.xml.
I want to access this connection string in my POJOs. How do I grab my connection?

example :
        DCIteratorBinding dciterb =(DCIteratorBinding)dcbind.get("ParcelsView1Iterator");
        dciterb.executeQuery();
        DCDataControl dc = dciterb.getDataControl();
        ApplicationModule am = (ApplicationModule)dc.getDataProvider();
        Statement st = am.getDBTransaction().createStatement(0);rg Thomas

Similar Messages

  • Adworker using wrong JDBC connect string during upgrade to 12.1.3

    Our env
    APPS - 12.1.2 - running on SLES 11
    DB 11.2.0.3 - running on IMB System z
    We cloned PROD to a new host (instance was previously on DB host - debsdb01 and app host debsap03)
    The clone was made to debsdb04 - and app was reconfigured on debsap03
    I got the app to start up and run before taking it down to apply the 12.1.3 patch.
    However, in the process of the 12.1.3 patch, I see the following entry in the ADworker log files.
    JDBC connect string from AD_APPS_JDBC_URL is
    (DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=YES)(FAILOVER=YES)(ADDRESS=(PROTOCOL=tcp)(HOST=hostname1.companyname.com)(PORT=1549)))(CONNECT_DATA=(SID=DEV3)))
    where as it should be
    JDBC connect string from AD_APPS_JDBC_URL is
    (DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=YES)(FAILOVER=YES)(ADDRESS=(PROTOCOL=tcp)(HOST=hostname4.companyname.com)(PORT=1535)))(CONNECT_DATA=(SID=DEV3)))
    If I do an echo $AD_APPS_JDBC_URL on debspap03, it returns
    JDBC connect string from AD_APPS_JDBC_URL is
    (DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=YES)(FAILOVER=YES)(ADDRESS=(PROTOCOL=tcp)(HOST=hostname4.companyname.com)(PORT=1535)))(CONNECT_DATA=(SID=DEV3)))
    Where are the ADWORKERS getting the old value of the DB host name?
    Any help would be appreciated.
    Thanks
    Edited by: 864641 on Sep 16, 2012 7:32 AM

    I believe figured out what the issue was.
    I was (am) running the patch session from a VNC session that was established during the previous version of this instance - so the previous connect string was being used.
    Once I killed the old VNC session and established a new one, I was able to retrieve the correct value for $AD_APPS_JDBC_URL from the command prompt.
    Yes - the value of the $AD_APPS_JDBC_URL was showing the old value in the old VNC session.
    Thanks for all of your input esp on a Saturday - when I thought I would have to wait until Monday to get this figured out.

  • To read a connection string from a notepad

    i want to read the DSN-less connection string from a notepad that is from a text file so that if server ip address changes then it will be easy to change the ip address in the notepad rather than changing the code .we are using jsp.
    Connection con=DriverManager.getConnection("jdbc:odbc:DRIVER={SQL Server};Database=profile;Server=10.11.144.124;uid=sa;pwd=sa123");
    so this connection should be read from the text file
    any suggestions
    Thanks for ur help

    i want to read the DSN-less connection string from a
    notepad that is from a text file so that if server ip
    address changes then it will be easy to change the ip
    address in the notepad rather than changing the code
    .we are using jsp.
    Connection
    con=DriverManager.getConnection("jdbc:odbc:DRIVER={SQL
    Server};Database=profile;Server=10.11.144.124;uid=sa;p
    wd=sa123");
    so this connection should be read from the text file
    ny suggestions
    Thanks for ur help=> Good way of getting the DSN or any other setting from a text file is create a simple bean(will have get and may have set method too)that will read the data from the text file and use the bean anywhere in your jsp page(As it will also improve the performance of the application)and the bean initilizd once can be reused anywhere in the application.

  • Specify tablespace within JDBC connect string...

    In MySQL, I can specify a database name within a JDBC connect string. Can one specify an Oracle tablespace within a JDBC connect string? The goal is to have one account to access multiple tablespaces.
    Please advise,
    R

    R,
    I think perhaps you misunderstand what a tablespace is in Oracle.
    If you haven't already done so, I suggest reading Oracle Database Concepts and Oracle Database Administrator's Guide which are part of the Oracle documentation and available from:
    http://www.oracle.com/technology/documentation/index.html
    Good Luck,
    Avi.

  • BLOB / CLOB operations using JDBC connections taken from WebLogic 6.0 connectrion pool

    Hi..
    I need to do some CLOB operations using JDBC connection taken
    from WebLogic 6.0 connection pool. Will weblogic 6.0 supports it.?
    I am getting errors when trying to do it in normal way .
    It seems like ResultSet.getClob() returns an RMI (kind of ) object
    instead of the Clob object.
    If you have any idea . Pls respond to [email protected]
    Nazilin

    Hi..
    I need to do some CLOB operations using JDBC connection taken
    from WebLogic 6.0 connection pool. Will weblogic 6.0 supports it.?
    I am getting errors when trying to do it in normal way .
    It seems like ResultSet.getClob() returns an RMI (kind of ) object
    instead of the Clob object.
    If you have any idea . Pls respond to [email protected]
    Nazilin

  • JDBC connection strings

    We're having a problem connecting to one of our databases using JDBC thin. There seem to be two formats for the connection strings:
    jdbc:oracle:thin:@opctest.deq.state.ms.us:1522:TEST8131
    jdbc:oracle:thin:@//opctest.deq.state.ms.us:1522/TEST8131
    From a java app, the first throws an "Io exception: Invalid connection string format, a valid format is: "//host:port/service_name" " error; the second throws a TNS-12514: TNS:listener does not currently know of service requested in connect descriptor error.
    What confuses me more is that if I test this string from a JSP page:
    jdbc:oracle:thin:@opctest.deq.state.ms.us:1522:test8131
    it connects fine.
    The environment is Oracle9i on Red Hat, running MTS. Java app is running on WinXP. Anyone have an idea what's going on?
    Thanks,
    Harry

    I can see a couple of issues in your connect string:
    1. I see you are using the sid in uppercase, TEST8131 instead of test8131. If you are working on a unix environment this makes a difference, so use the lower case instead.
    2. You are using the 1522 port, check with your database administrator if the instance is registered against the 1522 port, otherwise the error TNS-12514 will show up. I will assume it currently works fine since you have declared the jsp using the same address works fine with this port.
    3. Ensure the hostname can be solved just exactly the way you have declared it (fully qualified domain) from the perspective where the jdbc program is running.
    4. the format described here: opctest.deq.state.ms.us:1522/TEST8131 is known as the EZConnect, and it is a 10g feature.
    ~ Madrid

  • JDBC connection string to an MS Access DB

    Hello,
    I was searching for a package that will allow me to do
    a JDBC connection to an MS Access DB. I found out about RMIJDBC, but I am not sure what I need to specify as my connection string. In SQL Server you usually give a url as well, but how about MS Access?
    How do you do a connection??
    Thank you for your help!
    -Lia-

    Why not using the Jdbc/Odbc driver with the Odbc connection of MS Access ? The driver name is "sun.jdbc.odbc.JdbcOdbcDriver" and the URL is something like "jdbc:odbc:myAccessOdbcName".
    Of course, this is not the fastest driver, but it is provided in standard with the JDK.
    Matthieu

  • Server name problem-jdbc connection string

    hi..
    my server name is SERKANPROX\LOCALHOST .. i couldn't connect to this server with this server name . how can i write the server name in connection string?. this is the part my code:
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://serkanprox//localhost:1 433;DatabaseName=NorthWind","serkan","serkan");
    the exception is : [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
    i can connect to the server which name is "serkan" . but when there is a '\' character ,i couldn't..
    how can i can change the connection string for connecting to this server ..
    thanksss

    hi..
    my server name is SERKANPROX\LOCALHOST No it isn't. Get the right server name. This problem has nothing to do with your username and password and such.

  • Getting Exception in jdbc connection got from DataSource in Oracle AS

    Hi
    i am using data source in my application.
    When my application is invoked it gets the jdbc connection from the data source, performs set of operations and then releases the connection.
    But if the application is invoked after a long time e.g. 10 hours then i get the following exceptions which i have logged:
    Io exception: Connection reset
    and the other exception is given below:
    Closed Connection
    The data-sources.xml is as follows:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    <data-source
    name="MYDS"
    class="oracle.jdbc.pool.OracleConnectionCacheImpl"
    location="jdbc/myDSCON"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="xxxxxxxx"
    password="xxxxxxxx"
    url="jdbc:oracle:thin:@localhost:1521:orcl"
    inactivity-timeout="30"
    max-connections="100" >
    <property name="cacheScheme" value="1" />
    </data-source>
    </data-sources>
    Please let me know what is wrong with my application or configuration setting or something is wrong with oracle application server.

    Hi,
    I found one solution which is for 10.1.2.x and i am using Oc4j 10.1.3.1 but solution is below
    Solution
    There is a new setting called "ValidateConnections" from 10.1.2.x. This setting will make sure to check the validity of the connections before it is assigned to the application.
    1. Download and apply the patch for unpublished bug 4305639 for your current 10.1.2.x version. If a patch is not already available then please submit a backport request to get the patch to your version.
    2. Set the command line option "-DValidateConnections=true" and restart the container. This can be set via EM AS control or by manually updating opmn.xml file. After the changes the options should look like
    <process-type id="oc4j_test1" module-id="OC4J">
    <module-data>
    <category id="start-parameters">
    <data id="java-options" value="-server -Djava.security.policy=/opt/oracle/jw101202/j2ee/oc4j_test1/config/java2.policy -Djava.awt.headless=true -DValidateConnections=true" />
    <data id="oc4j-options" value="-properties"/>
    Regards,

  • Jdbc, connection string to a rack

    hello,
    can i connect on jdbc receiver side to a rack ( logical instance instead of a physical instance) or to 2 ipaddresss instead of one in case one node gets down?
    i currently have a connection string as : jdbc:oracle:thin:@ipaddress:port:Databasename
    Please suggest.
    Thanks

    Closing thread.

  • Jdbc connection string

    Hi All,
    I am trying to connect to sysbase tables with
    Connection String: <b>jdbc:sybase:TDS5:DB110:3400:falud002</b>
    JDBC Driver: <b>com.sybase.jdbc3.jdbc.SybDriver</b>
    But it gives me error in RWB as:
    <b>Error during database connection to the database URL 'jdbc:sybase:TDS:DB110:3400:falud002' using the JDBC driver 'com.sybase.jdbc3.jdbc.SybDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:sybase:TDS:DB110:3400:falud002': SQLException: JZ0D5: Error loading protocol com.sybase.jdbc3.tds.TDS.'</b>
    Please advice....
    Xier

    Hey
    i know you might have done it but just want to make sure whether u have installed the proper drivers for Sybase or not?
    Thanx
    Aamir

  • JDBC Connection String for MS Sql Server 2000 with Instance Name

    Hi All,
    I am having problems connecting to a MS Sql Server 2000 database using MSSqlServer4
    driver when the database server has an Instance Name. If the database server has
    no instance name then I am able to connect using the connection string
    connection=jdbc:weblogic:mssqlserver4:hansa:1433
    But when I have the MS Sql Server DB with an instance name such as "TestInstance",
    then I am unable to connect with any of the connection strings given below
    connection=jdbc:weblogic:mssqlserver4:hansa\TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa\\TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa:TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa:1433:TestInstance
    Can anybody help me in resolving this issue. Appreciate your help.
    Thanks in advance.
    Vikram

    Vikram wrote:
    Hi All,
    I am having problems connecting to a MS Sql Server 2000 database using MSSqlServer4
    driver when the database server has an Instance Name. If the database server has
    no instance name then I am able to connect using the connection string
    connection=jdbc:weblogic:mssqlserver4:hansa:1433
    But when I have the MS Sql Server DB with an instance name such as "TestInstance",
    then I am unable to connect with any of the connection strings given below
    connection=jdbc:weblogic:mssqlserver4:hansa\TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa\\TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa:TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa:1433:TestInstance
    Can anybody help me in resolving this issue. Appreciate your help.Hi. No type-4 jdbc driver is going to be able to use a name for a DBMS instance.
    Let's assume you have two DBMS instances running on the machine hansa. One
    of them may be listening for tcp connections on port 1433, but the other must not.
    The other most be listening on some other port number you have chosen.
    Therefore, to choose which DBMS instance you want to connect to, use the
    working URL you have, and switch the port number as desired.
    Joe Weinstein
    >
    >
    Thanks in advance.
    Vikram

  • Load balance not working right with jdbc connection string?

    For months we've used the following connection string to get Tomcat to open connections to our Oracle 10g RAC:
    jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST
    = db1vip) (PORT = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST = db2vip)
    (PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED)
    (SERVICE_NAME = orcl) (PREFER_LEAST_LOADED_NODE_ORCL = OFF) ) )
    Today, db2 became inaccessible during prime time, and the web app completely hung--when you tried to type in a username and password to log into the site, it would just hang indefinitely, and the Tomcat log files were complaining about being unable to open a connection to the database because of a network adapter error.
    I would have expected the JDBC driver Tomcat was using to just switch to the other database server, but none of our Tomcat machines did that, and I'm wondering why (they all just hung trying to connect to db2). Our guess is that the difference this time is not that Oracle was down on db2, but that db2 was down entirely. Maybe that connection string works only if the server is up when the database is down, and not when the server is unreachable (we couldn't SSH to the box, and when we tried to get to it locally using a remote access card, a lot of options were grayed out and we couldn't see a shell, so all we could do was reset the box).

    Hi,
    Please refer to the link below:
    SCOM 2012 – Monitoring Oracle Database OLE DB Management Pack Template
    http://stefanroth.net/2012/12/05/scom-2012-monitoring-oracle-database-ole-db-management-pack-template/
    Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Retrieve data source connection string from reportserver.dbo.DataSource

    I would like to retrieve the connection string (and credentials) for each of my data sources (without having to click on each individual item). The DataSource table has a column called ConnectionString, but the data type is image, which cannot be converted to varchar. Does anyone have any ideas of how to pull this information from the database?
    I have tried converting to binary/varbinary, and then converting to varchar, but I get garbage back.
    Note: I am currently using SSRS 2005
    Thanks,
    Marianne

    Hi Jin,
    I downloaded your script and was impressed with the information it retrieves, however, it is not formatted very well with the name of each data source being on the same line as the previous data source so I updated the script to create a blank line between
    each data source block, and also to include the login credentials used by the data source, and the path for the data source, which is very useful in being able to locate the data source for editing in Report Manager. However, it is not retrieving all data
    sources and I don't know why. I know this for a fact because there are data sources defined that are not in the output of this script but I don't know enough about VB to improve the script further, or how the report server is configured to ensure the code
    finds the missing data sources.
    Here's the updated script.
    '=============================================================================
    '  File:      PublishSampleReports.rss
    '  Summary:  Demonstrates a script that can be used with RS.exe to
    '      publish the sample reports that ship with Reporting Services.
    ' This file is part of Microsoft SQL Server Code Samples.
    '  Copyright (C) Microsoft Corporation.  All rights reserved.
    ' This source code is intended only as a supplement to Microsoft
    ' Development Tools and/or on-line documentation.  See these other
    ' materials for detailed information regarding Microsoft code samples.
    ' THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
    ' KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
    ' IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
    ' PARTICULAR PURPOSE.
    Public Sub Main()
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials
        'Create the parent folder
        GetCatalogItems(String.Empty)
    End Sub
        ' <summary>
        ' recursivly get folder items from report
        ' server catalog; render to treeview control
        ' </summary>
        ' <param name="catalogPath"></param>
        ' <param name="parentNode"></param>
        Public Sub GetCatalogItems(ByVal catalogPath As String)
            Dim items As CatalogItem()
            Try
                ' if catalog path is empty, use root, if not pass the folder path
                If catalogPath.Length = 0 Then
                    ' no recursion (false)
                    items = rs.ListChildren("/", False)
                Else
                    ' no recursion (false)
                    items = rs.ListChildren(catalogPath, False)
                End If
                ' iterate through catalog items and populate treeview control
                For Each item As CatalogItem In items
                    ' if folder is hidden, skip it
                    If item.Hidden <> True Then
                        ' ensure only folders are rendered
                        If item.Type.Equals(ItemTypeEnum.DataSource) Then
                            'use the GetDataSourceContents to get the definition of the data source.
                            Dim definition As DataSourceDefinition = Nothing
                            Try
                                definition = rs.GetDataSourceContents(item.Path)
                                Console.WriteLine(item.Name)
                                Console.WriteLine(item.Path)
                                Console.WriteLine("Connection String: {0}", definition.ConnectString)
                                Console.WriteLine("Extension name: {0}", definition.Extension)
                                Console.WriteLine("UserName: {0}", definition.UserName)
                            Catch e As SoapException
                                Console.WriteLine(e.Detail.InnerXml.ToString())
                            End Try
                            Console.WriteLine(item.Name)
                            Console.WriteLine()
                        ElseIf item.Type.Equals(ItemTypeEnum.Folder) Then
                            ' recurse                     
                            GetCatalogItems(item.Path)
                        End If
                    End If
                Next
            Catch ex As Exception
                Console.WriteLine(ex.Message)
            Finally
                'Do nothing
            End Try
        End Sub
    To run this I use:
    rs -i GetPropertiesOfDataSources.rss -s
    http://<reportserver_name>/reportserver > DataSources_<reportserver_name>.txt
    But as I mentioned it is not picking up all of the data sources and I don't know why. I also don't know why it's so difficult to find all the data sources from within Report Manager. I'm new to SSRS but was told that prior to SQL 2005, this information was
    easily available using Management Studio to connect to the report server but now it's buried in the Report Manager and not accessible from one spot. Bad move by Microsoft apparently. You'd think that there would be an easy way to find all of the data sources.
    We need to migrate the SQL Servers on which reports are running, but we have tons of reports and, historically, little documentation for them so we need to be able to determine where all the data sources are so we know which to update. This is proving extremely
    difficult. Your script helps but is not comprehensive.
    Any and all help is appreciated.
    Michael MacGregor, Senior SQL Server DBA, Carlson Marketing

  • Constructing a correct jdbc connection string

    I am not particularly fluent in JDBC URL construction and though I have come up with many variations, I have so far failed to come up with the single variation that will work for my database :-)
    I am running Oracle 10 and I have a connection to the target database in SqlDeveloper. Opening the properties of my existing connection, I observe that the type is TNS. Looking up the network alias specified in my tnsnames.ora I was then able to get the hostname, the service name, and the port (1521), and I observed that it said "Server=DEDICATED" though I don't appreciate the significance of that last item.
    So I tried IBM's jdbctest tool (among others) with a JDBC URL of:
    jdbc:oracle:thin:<username>/<pwd>@<hostname>:1521:<servicename>
    and with the ojdbc14.jar driver, received this error:
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    I also tried "telnet <hostname> <port>" because jdbctest suggested it, and I received "Connect failed". jdbctest notes that a refused connection means the port is wrong but says nothing about a failed connection. I saw one reference that said the last component of the string should be <dbname> rather than <servicename>. So where do I check the dbname? And what else am I missing?

    jdbc:oracle:thin:<username>/<pwd>@<hostname>:1521:<servicename><servicename> is SID of databsae running on server and not your tnsname alias.
    Telnet can fail if telnet service is not running.
    Did you tried tnsping
    c:\>tnsping <tnsnames.ora service alias>
    Server=DEDICATED indicates that you want to have dedicated oracle process for your applicaiton unlike shared server process where many users share the same proecss. Shared server connection is typically used for large number of db users conencting concurrently.

Maybe you are looking for

  • Error while deploying the par file

    while deploying  an application in NWDS we are getting the error as"operation failed,please make sure that the server is running or check the log." we have ensured that the server is running,but the deployment is getting failed. Please suggest tips t

  • PSE 9 does not save transparant GIF's

    The background eraser in PSE 9 does not work correctly, in that it erases very small areas instead of size of the setting.  Then when I save a GIF transparant background the background is white.  I've just upgraded from PSE8 to 9, and did not have th

  • Stateful ARFC2 transaction in Webdynpro for Java ?

    Hi, The code in wdInit like this executed input and input1 in different r3 session. Arfc2model model = new Arfc2model(); Rfc_input input = new Rfc_input(model); input.execute(); Rfc_input input1 = new Rfc_input(model); input1.execute(); How to implem

  • Multiple Presentation Services -OBIEE

    Hi, I have 2 RPDs which needs to be deployed in OBIEE. I want to view the analytical reports of both these RPDs. However the data sources of these 2 RPDs are different. Also, I have installed OBIEE on Linux Machine. Would it be possible to have 2 ins

  • Single BPEL process to server different system?

    Hi All, I have one source system and have three target system. Source System - S1 (Oracle System) Target System - T1, T2, T3 (oracle System) I need to pass supplier data from S1 to T1, T2, T3. I need to create only one single BPEL process to acheive