Announcement Announcement Module
Collapse
No announcement yet.
Connecting to an Oracle DB through SID Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connecting to an Oracle DB through SID

    I want to connect to an Oracle database, through a SID. The problem is, I can't find a configuration to do it. We used to connect to an Oracle DB on IP and Port, but it should be SID now.

    Can someone help me correct this configuration:
    Code:
    <bean id="geoDataSource" class="org.apache.commons.dbcp.BasicDataSource">
    	<property name="driverClassName" value="oracle.jdbc.OracleDriver" />
    	<property name="url" value="jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = XXX.XXX.XXX.XXX)(PORT = XXX))(ADDRESS = (PROTOCOL = TCP)(HOST = XXX.XXX.XXX.XXX)(PORT = XXX))(LOAD_BALANCE = yes)(CONNECT_DATA =(SERVICE_NAME = SERVICE_NAME)))" />
    	<property name="username" value="USER_NAME" />
    	<property name="password" value="PASSWORD" />
    </bean>
    Last edited by Bjorn121; Oct 25th, 2007, 07:35 AM.

  • #2
    I found this link: http://www.jguru.com/faq/view.jsp?EID=444466 and I changed it to jdbc: oracle:thin: @localhost:1521:SID, but that doesn't work either.

    Error:
    Io exception: The Network Adapter could not establish the connection

    If anybody has some advice, feel free to share it .

    Comment


    • #3
      Well obviously the database cannot be accessed, do you run your database locally with the given SID? Or is it on another server?

      Comment


      • #4
        It's on another server. I want to connect to a client, which knows where the database is located, so I don't have to use magic with an IP as a wand. The problem is that no matter what configuration I use, it always fails.

        I've been looking at it all day, but I can't find a solution.

        Comment


        • #5
          1. Make sure the oracle client is running/installed on your local machine
          2. Not sure of the client listens on 1521

          We use a remote client with pretty much the same configuration...

          Comment


          • #6
            Client is running, because other applications use the same client. If it wouldn't be up, I think a lot of clients would be calling right now .

            I used 1521 en 1621 and no result thus far. What is your configuration, if I may ask? Just erase the sensitive data.

            Comment


            • #7
              Which configuration do you mean? My jdbc url?

              Code:
              jdbc:oracle:thin@[server]:1521:[SID]

              Comment


              • #8
                I assume that server is the server where the client is installed? Just to be sure.

                Comment


                • #9
                  Originally posted by Bjorn121 View Post
                  It's on another server. I want to connect to a client, which knows where the database is located, so I don't have to use magic with an IP as a wand. The problem is that no matter what configuration I use, it always fails.
                  I'm not entirely sure I understand your configuration, but it sounds like you want your application on machine A to connect to a database on machine B. If that is the case, then the connection string in the application will have to have a server name/ip address in it. I suppose you could use a generic server name and redirect that name to the proper server using the localhosts file on machine A. Another alternative would be to use Oracle Names (or whatever it is Oracle is calling it now).

                  Comment

                  Working...
                  X