Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 111907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:27:40+00:00 2026-05-11T02:27:40+00:00

While trying to connect to a database that’s set to read only, the connection

  • 0

While trying to connect to a database that’s set to read only, the connection cannot be made. I get the following error:

Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not  establish the connection) 

The application needs to run in read-write mode and then automatically handle the switch to read-only by only checking the isReadOnly property of the connection object. The application runs correctly when connecting to a read-write database, but fails when I change to the connection string below (with security information removed). I’ve verified that the connection string is correct, so the problem doesn’t lie there.

ca.businesssolutions.nbs.jdbc.connect=jdbc:oracle:thin:unicorn_read_only/password@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=9999)))(CONNECT_DATA=(SID=SBSBTST)(SERVER=DEDICATED))) 

I’m having trouble trying to figure out where to start looking. I inherited the application and am not sure if it’s a spring framework limitation or another setting I’m missing.

The spring configuration for the datasource is:

<bean id='dataSource' class='ca.businesssolutions.nbs.server.base.datasource.MyBasicDataSource'       destroy-method='close'>     <!--url and driver class name are set through Configuratoin object.-->     <property name='initialSize' value='10'/>     <property name='maxActive' value='-1'/>     <property name='validationQuery' value='SELECT 1 FROM DUAL'/>     <property name='accessToUnderlyingConnectionAllowed' value='true'/> </bean> 

The Data Source constructor:

public MyBasicDataSource() {     super();     setUrl(Configuration.get(Configuration.CONNECT));     setDriverClassName(Configuration.get(Configuration.DRIVER_NAME));     //The initial number of connections that are created when the pool is started.     int numConnections = 10;     try {         numConnections = Integer.parseInt(Configuration.get(Configuration.NUMBER_OF_CONNECTIONS));     } catch (Exception exception) {         // Do nothing.     }     setInitialSize(numConnections);     //The maximum number of active connections that can be allocated from this pool at the same time, or non-positive for no limit.     setMaxActive(-1);     setValidationQuery('SELECT 1 FROM DUAL');     setAccessToUnderlyingConnectionAllowed(true);     DataAccessObject.setDataSource(this); } 

What else would help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:27:40+00:00Added an answer on May 11, 2026 at 2:27 am

    What’s the difference between read/write and read-only connect string? Is there any chance for a typo? Have you tried this connect string from another tool (but from the same host)? Try using a Java GUI Tool on the same computer that you have difficulties connecting from. Use Copy/Paste with your exact connection string.

    If this doesn’t work either, you might have an unresolvable hostname, firewall issues or something else. If it does work from the same computer leave a comment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 189k
  • Answers 189k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can add a guard, i.e. an if and a… May 12, 2026 at 5:47 pm
  • Editorial Team
    Editorial Team added an answer Standard C and C++ allow you to use a macro… May 12, 2026 at 5:47 pm
  • Editorial Team
    Editorial Team added an answer How about using a sorted list that places the image… May 12, 2026 at 5:47 pm

Related Questions

While trying to connect to a database that's set to read only, the connection
I'm using SQL Server 2008. I should be able to connect to a user-specified
This wiki post outlines both a problem and a solution. I wanted to post
I am trying to make a copy of a database to a new database
How to access a remote database with Visual Basic 6? It's been a while

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.