What type of data type would I use for this situation?

I have a class which connects to Oracle, but each connection may be to a different database. Each database has it's own user name and password.
I'd like to pass one key value and then the class would get the user name and password and url from that but not sure how to do it.
Right now, for the function I pass it the url, username, password which then calls a connection function and passes it the same value. This seems messy keep passing values around.
Is there some kind of enumerations or something ?

You might consider putting the URLs, usernames and password into a properties file.
The properties file might contain:
all.databases=database1,database2,database3
database1.user=user1
database1.password=dingbat
database1.url=jdbc:oracle:thin:dohdah:base1
database2.user=someone
database2.password=toad
database2.url=jdbc:oracle:thin:xyx:dsds
Then use ResourceBundle.getBundle() to load the properties and you can just do
Connection con = DriverManger.getConnection(bundle.getString(key + ".url"),bundle,getString(key + ".user"), bundle.getString(key + ".password");

Similar Messages

  • What camera raw default settings would you use for the Canon 5D Mark 3. I have PS CS6.  Thank you.

    What camera raw default settings would you use for the Canon 5D Mark 3. I have PS CS6.  Thank you.

    Really, this is a question you should be asking yourself...
    What do you shoot? Makes a difference...
    Typical ISO that you shoot? Makes a difference...
    Shooting for clients or yourself? Makes a difference...
    Look, there is no magic bullet...the ACR/LR "Default" should only be changed for those adjustments you make 70-90% of the time and sould not be confused with image by image adjustments...
    So, as asked, your question can not really be answered other than to say, use a default that suits you.

  • What type dvd to use for recovery?

    I need to know what type dvd to use to make recovery disc? I read a dvd+r verbatum or sony on one post then aother said dvd-r Im confused please help! also how many disc will I need ?  I have a X505 Q870 any help would be greatly appreciated. Thanks

    it really depends on your laptop. some will work with +r and some with -r. you will need anywhere between 2 and 6 dvds. you should be fine with anything other than memorex.
    -civicman4-
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Post all info about your laptop and version of windows. We are working on it but still do not have the powers to read your mind.

  • What is the best camera technique to use for this project?

    hi, im making a small thing for my gf on motion. i have it so that certain text appears along with pictures. i want the camera to pause momentarily to read what it says and then begin moving to the next set of text/pictures, then stop there for a little while too, then go on to the next one, etc etc.
    whats the best way to do this? the pictures/text are NOT in a straight line so making the camera go straight through wont work. one might be directly in front of the camera then i will have made the next set to be directly downward so i want the camera to swoop down there and pause on them, then the next set might be straight up all the way at the top etc. how can i get the camera to move then pause, move then pause over and over where i want it to until the project is over?
    sorry if this is a noob question but i have no idea
    thanks!!

    What version of the studio are you using?
    In Motion 3 you could try keyframing the camera move , the zoom layer behavior, or Move behavior.
    If you've got Motion 4, try the Camera Framing Behavior.
    There are several ways to accomplish what you want to do, it really comes down to what you are most comfortable with.

  • What type of column to use for this situation in SharePoint 2010?

    Hi there,
    In a SharePoint 2010 list - I have to add a few columns which need users to pick a numeric value and it's unit of measurement. E.g.
    - 30 (Inches/ft/cms)  <-- Here 30 is a number field and then a dropdown to select a unit.
    An option is to create two columns (1st - Number type and 2nd Dropdown with Inches/ft/cms values).
    But I have a lot of such sets in the same list and am not sure if above is the best way to go?
    Are there any other options for me? Is a Site Content Type a good option? Anything else?
    Thanks.

    Hi,
    I can think of two ways that you can accomplish what you are trying to -
    1. Content types could be a way or Create Site columns and prepopluate the values in these columns and use it in your list
    2. create custom column (C#) see here for more info -http://msdn.microsoft.com/en-us/library/ff648469.aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if the reply helps you

  • What SONG would you use for this slideshow?

    I'm working on a slideshow that basically chronicles the first year of my son's life for his 1st birthday. I've hit a creative road block and was wondering if anyone had any good ideas for a song that would fit perfectly to go along with this occassion.
    Thanks for your help = )

    John Lennon's "Beautiful Boy"

  • I am a fitness director and looking for an app that will allow me to sale and track group fitness classes. What app do you think would be best for this?

    I want to sale classes individually and in packages. I'll need to track when purchases are made and then when credits have been redeemed (if they purchased a package of classes). I suspect I'd need an app in the bussiness category, but there are so many and some with a few qualities I'm looking for, but missing a key component. I can't be the only one looking for a solution like this. Right?!

    Your posting this in the spreadsheet forum for Apples iWork program called "Numbers" on mobile devices (iOS).
    Please let us know if you are attempting to make a spreadsheet to track this (This forum)
        or
    Looking for a premade app to do this (a different forum/website/search)
    If the first choice, please give us more information on what aspect of the spreadsheet is giving you an issue and we can attempt to help out some.
    Thanks
    Jason

  • What SATA hard drive(s) would one recommend for a G4 Sawtooth?

    I plan to replace the main IDE/ATA/PATA hard drive on a 400 MHz G4 Sawtooth.
    What SATA hard drive(s) would one recommend for this system? The recommendation can be regarding brands in general or a particular model.
    Thank you.
    -John

    This feature ONLY comes into play on a Drive that has developed Bad Blocks that have not yet been corrected by re-writing the data.
    What happens when you attempt to Read data from a Bad Block on a drive without that feature, the drive will Retry, and retry, and retry, in an attempt to get data that is good enough that the drive's error-correction logic can correct it. This can take so long that the RAID driver declares the drive as inaccessible, and splits the RAID into a functioning and a non-functioning unit, and declares the RAID compromised* ( that's not the word they use, but the correct term escapes me at the moment.)
    Drives with Bad Blocks are more likely to develop more Bad Blocks and fail later.

  • What Extractor can be used for this purpose?

    Hi all
    I have a requirement for a new report. The user wants to get a report regarding inbound cost saving including materials, material group, MRP controller, vendor, date, qty, actual inbound transportation cost, standard transportation cost which is fixed in SAP and variance between actual and standard.
    Can any one advice me what Extractor and Extract Structure can be used for this purpose?
    Thanks in advance
    Ishi
    Edited by: eletter on Sep 28, 2009 11:11 AM

    Hi
    Extract structure
    The extract structure, data from a DataSource is staged in the source system. The extract structure contains the amount of fields that are offered by an extractor in the source system for the data loading process.
    Extractors
    Extractors is a data retrieval mechanisms in the SAP source system. Which can fill the extract structure of a data source with the data from the SAP source system datasets. The extractor may be able to supply data to more fields than exist in the extract structure.
    Hope this helps you
    santosh

  • What brands and type can I use for my iMac 20" internal Hard Drive?

    what brands and type can I use for my iMac 20" aluminium internal Hard Drive?
    can I use WD caviar black?
    is it too hot?

    If you are replacing the drive because the existing one is faulty, that's one thing. If you just want more space, you should take advantage of having a decently fast and relatively small capacity drive in there now (instead of a huge drive). Get an external FireWire drive and off-load most of your user data there. Make your internal drive dedicated to mostly your OS and app files, with plenty of free space. That setup will make your iMac run more efficiently. I won't go into more detail, because I'm not answered your specific question... You can post back with any questions, if interested...
    To answer your questions...
    You should be able to use any SATA 3.5-inch drive internally, but you should probably keep it at or under 1TB. The main concerns are power usage and heat dissipation. A drive like the WD Caviar Green would be ideal in terms of power and heat, but they do have slower (or variable) spin rate. I have one as an external drive (750GB) and it is amazingly quiet and cool. If I had to replace the internal drive because the current drive failed, I'd put it inside. I'll trade a bit of pure performance for the efficiency (including low noise), and these drives are more advanced with higher data density and larger cache, so the trade-off from slower spin rate may not be so bad.
    You can check your current drive's model number (which is shown in System Profiler) to get the specs online. The stock drive in my old +Late 2006+ iMac is a 7200 RPM drive. The Caviar Black is a 7200 RPM drive, with a newer design. So if you want to use a Caviar Black in there, I think it would be OK.

  • What type of class would I create for this?

    I want users to extend a class which has the following methods that are implemented:
    getters (optional if they use or not)
    setters - must use
    various types of methods - must use
    Arraylist of a specific optic (hence the setter).
    I dont think there is such a class from what i remember from school. I know abstract classes will do the whole "implemented methods" part.
    Such a class would be used for people to create new objects that is used to build "extensions" to an existing application
    Currently I am using an interface but I know that wont do the job for the array list part.
    Or - am I looking at this all wrong?

    user8974754 wrote:
    I want users to extend a class which has the following methods that are implemented:
    getters (optional if they use or not)
    setters - must use
    various types of methods - must use
    Arraylist of a specific optic (hence the setter).Like jverd, I'm not quite sure what you mean by "must use". If you mean that they must use your class's method, define it as final; otherwise don't.
    I'm also not sure what the ArrayList (or List, as I suggested in your other thread) is trying to accomplish. Is it supposed to be some "global" collection that keeps track of all extensions anyone has defined? If so, I reckon that it properly belongs in an 'Application' object, and that clients "register" their extension with the Application; however, I'm not at all sure you actually need to do that.
    Or - am I looking at this all wrong?I think you need to explain your problem further. What is the type that clients are supposed to extend? What are you using the List for?
    Also, inheritance is only one way of creating extensions; and it's not always the best because it tends to create rigid hierarchies that are difficult to change later on. You might also want to read up on composition, Wrappers and the Decorator Pattern.
    Winston

  • I have a Mid 2009 15 inch MacBook Pro with  2.53 GHz Intel Core 2 Duo and 4 GB 1067 MHz DDR3. Can this MacBook be upgraded to 8GB? If so, what type would you recomended

    I have a Mid 2009 15 inch MacBook Pro with  2.53 GHz Intel Core 2 Duo and 4 GB 1067 MHz DDR3. Can this MacBook be upgraded to 8GB? If so, what type would you recomended

    Awesome! Thank you What about the Corsair brand?
    http://www.amazon.com/Corsair-DDR3-Laptop-Memory-CMSO8GX3M2A1333C9/dp/B002YUF8ZG /ref=cm_cr_pr_product_top

  • ActiveX in BradySoft (CodeSoft) - What Class/Method/Object's would I use to send variable form data to BradySoft?

    What Class/Method/Object's would I use to send variable form data to BradySoft? I have a basic label setup in BradySoft and I want to send it variable form data (a serial number) from Labview ActiveX. I have attached Brady's ActiveX programmers guide but can't figure out what to use for this. P.S. I would call Brady or TekLynx tech support about this but they have a strict policy whereas BradySoft supports ActiveX but their tech support doesn't provide programming help with it. I figured I'd try the NI Forums.  

    Aaronb, I presume by publishing an ActiveX programmers manual the BradySoft software installs Active X objects. You may choose to interact with these objects within LabVIEW using Active X controls. The following link will provide a starting point for LabVIEW help topics on Active X communication: Select ActiveX Object Dialog Box
    http://zone.ni.com/reference/en-XX/help/371361F-01/lvdialog/insert_active_x_object/
    Building a Simple Web Browser Using ActiveX (Example of ActiveX arcitecture)
    http://zone.ni.com/devzone/cda/epd/p/id/81 Hope this helps provide a bit of guidance. Cheers!  

  • Any Idea Which Message type/Idoc Type should be used for FI Invoice

    Hi Experts,
    Any idea what message type/Idoc type should be used for FI invoice. We are going to send IDOC from R/3 to Non-SAP System using ALE. We are using T-codes FV60/FV65.
    Thanks,
    Sony

    Hi Sony,
    I never dealt with FI IDoc.
    I think you need to setup EDI outgoing payment in IMG. Please take look this report <b>RFFOALE1</b> - ALE Distribution of Payment Data and <b>RFFOEDI1</b> and check also the program documentation.
    Hope this will help.
    Regards,
    Ferry Lianto

  • Becouse of expire of credit card I updated billing information by providing data of new credit card but system just says "We're sorry, the billing information on file could not be used for this payment. Please update your information.". What exactly is wr

    Becouse of expire of credit card I updated billing information by providing data of new credit card but system just says "We're sorry, the billing information on file could not be used for this payment. Please update your information.". What exactly is wrong?

    Are you 100% sure that every detail of your information is the same in each place?
    Make sure that EVERY DETAIL is the same in every place you enter your information
    -right down to how you spell and punctuate the parts of your name and address
    Change/Verify Account https://forums.adobe.com/thread/1465499 may help
    -Credit card https://helpx.adobe.com/utilities/credit-card.html

Maybe you are looking for

  • How to use GUI_DOWNLOAD inside BSP Application event

    Hi All, I am facing one issue while using GUI_DOWNLOAD inside BSP Application. When the processing goes at GUI_DOWNLOAD it gives me unknown error where as the same code is working when used in report program. My requirement is to save password into e

  • Java.io.IOException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor

    Here by i am giveing code while(rs1.next())                     photo=rs1.getString(1);           strName=photo+" "+rs1.getString(2)+" "+rs1.getString(3);           strDesign=rs1.getString(4);           strLoc=rs1.getString(5);           strUgc=rs1.g

  • S. O. S.

    I am builiding this tiny interactive program. All of the background is .swf animations, so the idea is that you are in a menu (Flash scene) and when you push a button it is referenced to the transtion (another Flash scene) and then the end action of

  • P n L statements in SAP BI.

    HI, I am trying to explore the options for SAP BI Pn L statements. can someone help me how to go ahead. Currently i dont an idea how to start. Are there any standard reports i.e. tailormade P nL statements? Thanks.

  • I keep getting this serious error message... Please help soon! Project deadline is soon

    Hi, I use Premiere Pro on a 2012 Macbook Pro with 16GB DDR3 of memory, 7200rpm hard drive, 2.6 GHz Core i7 processor (dual core). I keep getting this error: [/Volumes/BuildDisk/builds/MightySilt/shared/adobe/MediaCore/AudioRenderer/Make/Mac/../.. /Sr