• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Prompting for username/pw with JDBC: where is that prompt coming from and where do my properties go?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using JDBC with the IBM toolbox to connect to tables on an AS400 server. When I establish a connection, I do not supply a username or a password to the URL, so I want the system to prompt the user. I don't want to hard-code any passwords or automatically put the admin password in. Bad idea. So prompt it is. I shove all my other settings into a property object and send it off:

My property-setting function looks like this:


Since I don't supply a un or pw, I get this nifty little box:


1. Where does this box come from? Is this a JDBC thing or an IBM toolbox thing? And can I intercept it? I'm curious to know if I can skin it. When I translate this project from desktop to android, I want to be able to spawn an android UI (since android doesn't know swing or awt).

2. if I check those two checkboxes, no matter how many connections I open and close, whatever I put into those un/pw fields persists. Is there a way to grab that un/pw data from somewhere? I tried grabbing the connection properties object, but all the fields come back blank to me. The IBM Toolbox site lists what properties to expect (I'm only interested in the general properties at this moment), but doesn't actually tell me where I can retrieve those properties.

This
yields me this
Not even close to what I should be expecting. Where did my properties go?

Thanks for any info!
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic