Announcement Announcement Module
No announcement yet.
Avoiding Dialog Box with BasicDataSource Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Avoiding Dialog Box with BasicDataSource

    I'm using BasicDataSource to open a connection. My problem is that if I give an invalid user or password, a dialog box appears giving me the chance to correct them.

    Since I'm running in batch, I don't want the dialog. How can I avoid this in an AIX or other Unix system?

  • #2
    Sounds like it's your API/JDBC driver that's prompting you with the dialog box. In any case, if you put the username/password in a properties file and they're correct, you should never be prompted. A little more details on your scenario would be good to get a better understanding.


    • #3
      RE: Avoiding Dialog Box with BasicDataSource

      Thank you, pgrimard. Sometime after posting, I learned what you've said. The problem is failure to set the "prompt" property in the driver to "false."

      Ideally, I'd be able to set connectionProperties from the application context thus:
      HTML Code:
      <property name="connectionProperties" value="prompt=false" />
      Unfortunately, the version of Apache Commons I'm using doesn't have a setConnectionProperties method. Fortunately, I'm already subclassing BasicDataSource, so I just hard-coded a call to addConnectionProperty.