Parameters in try block..pls help

I have the following code which I do not understand the reason it is not work. i.e. Putting the driver, dbURL, login, password value in the beginning work, however, setting it in the try blocks does not. Can you please help me? Thank you.
public ConnectionManager()
// (This block works OK if uncommented)
//driver = "com.mysql.jdbc.Driver";
//dbURL = "jdbc:mysql://localhost/BOOKINGSYSTEM";
//login = "root";
//password = "password";
try {
Properties Prop = new Properties();
InputStream configStream = ConnectionManager.class.getClass().getResourceAsStream("/config/database.properties");
Prop.load(configStream);
configStream.close();
//driver =Prop.getProperty("driver");
//dbURL = Prop.getProperty("dbURL");
//login = Prop.getProperty("login");
//password = Prop.getProperty("password");
// (This block DOES NOT works...why??)
driver = "com.mysql.jdbc.Driver";
dbURL = "jdbc:mysql://localhost/BOOKINGSYSTEM";
login = "root";
password = "password";
} catch(IOException e) {
System.out.println("Error: Cannot laod configuration file ");
}

I have the following code which I do not understand
the reason it is not work. i.e. Putting the driver,
dbURL, login, password value in the beginning work,
however, setting it in the try blocks does not. Can
you please help me? Thank you.What exactly do you mean by "it does not work"?

Similar Messages

  • Accound blocked pls help

    i cant use my skype adrees i think account blocked pls help me i wanna use my skype bychat1

    Try to release your account by filling out the information requested in the Online Resolution Center ;
    https://support.skype.com/account-recovery
    If in case still necessary, you can alsocontact customer support for clarifications or further assistance. Just click the link below to see the instructions on how you can get in touch with the Support team ;
    https://support.skype.com/en/faq/FA1170/how-can-i-contact-skype-customer-service
    CONTACT SKYPE CUSTOMER SERVICE   |  HOW TO RECORD SKYPE VIDEO CALLS  | HOW TO HANDLE SUPICIOUS CALLS AND MESSAGES   |  WINDOWS PROBLEMS TROUBLESHOOTING   |  SKYPE DOWNLOAD LINKS  
    MORE TIPS, TRICKS AND UPDATES AT
    skypefordummies.blogspot.com

  • Account blocked pls help not a week old!

    My account is suspended.
    But i have dont have a week this new account i am very happy about my new account.
    Today i get logout on phone and PC.
    i dont know what is the problem i change 3 times my password dont working i can't login.
    How to fix it pls help me...
    i hope you understand me.
    Username : [Redacted for privacy]
    First things, first: for your safety and protection, please never, ever include any personally identifiable information such as your real name, Skype account name, e-mail address, or a telephone number in a post on a public Community or forum such as this. Thanks!

    Hi, mather201, and welcome to the Community,
    Please check this FAQ to see if the steps outlined will help recover your account:
    https://support.skype.com/en/faq/FA10946/what-should-i-do-if-my-account-is-suspended-hacked-or-compr...
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • Pls help for Exception "Too Few Parameters : Expected 35"

    Hi,
    I am expericing with the exception
    "Too Few Parameters : Expected 35".
    What's wrong with it? The following is my code.
    try {                                                                                                                                                                                                                
    String DRIVER = ("sun.jdbc.odbc.JdbcOdbcDriver");               
    String URL = "jdbc:odbc:Industrial_One_DSN";
    String sql = "UPDATE BusinessRegistration " +
    "SET [Date] = ?, ISIC = ?, BizName = ?, BizAddress = ?, " +
    "OwnerName = ?, OwnerNRC = ?, Investment = ?, EstablishedYear = ?, " +
    "L_Male = ?, L_Female = ?, F_Male = ?, F_Female = ?, " +
    "OwnershipType = ?, Remarks = ?, IndustialZoneName = ?, Unit = ?, " +
    "Fuel = ?, FactoryType = ?, FactoryName = ?, Township = ? " +
    "MainProductName = ?, MainProductCountType = ?, " +
    "MainProductQuantity = ?, MainProductValue = ?, RMName = ?, " +
    "RMCountType = ?, RMQuantity = ?, RMValue = ?, EnergyName = ?, " +
    "MachinePower = ?, AmountGallon = ?, StateDiv = ?, BizSize = ?  " +
    "WHERE RegistrationID = ?";
    Class.forName(DRIVER);
    Connection con = DriverManager.getConnection(URL);
    PreparedStatement pstmt = con.prepareStatement(sql);
    int ilmale = Integer.parseInt(lmale);
    int ilfemale = Integer.parseInt(lfemale);
    int ifmale = Integer.parseInt(fmale);
    int iffemale = Integer.parseInt(ffemale);
    int impq = Integer.parseInt(mpq);
    int impv = Integer.parseInt(mpv);
    int irmq = Integer.parseInt(rmq);
    int irmv = Integer.parseInt(rmv);
    int iamountgallon = Integer.parseInt(amountgallon);
    pstmt.setString(1, date);
    pstmt.setString(2, isic);
    pstmt.setString(3, bizname);
    pstmt.setString(4, bizaddress);
    pstmt.setString(5, ownername);
    pstmt.setString(6, ownernrc);
    pstmt.setString(7, investment);
    pstmt.setString(8, eyear);
    pstmt.setInt(9, ilmale);
    pstmt.setInt(10, ilfemale);
    pstmt.setInt(11, ifmale);
    pstmt.setInt(12, iffemale);
    pstmt.setString(13, ownershiptype);
    pstmt.setString(14, remark);
    pstmt.setString(15, izn);
    pstmt.setString(16, unit);
    pstmt.setString(17, fuel);
    pstmt.setString(18, ft);
    pstmt.setString(19, fname);
    pstmt.setString(20, township);
    pstmt.setString(21, mpn);
    pstmt.setString(22, mpct);
    pstmt.setInt(23, impq);               
    pstmt.setInt(24, impv);
    pstmt.setString(25, rmname);
    pstmt.setString(26, rmct);
    pstmt.setInt(27, irmq);
    pstmt.setInt(28, irmv);
    pstmt.setString(29, ename);
    pstmt.setString(30, mpower);
    pstmt.setInt(31, iamountgallon);
    pstmt.setString(32, statediv);
    pstmt.setString(33, bizsize);
    pstmt.setInt(34, Integer.parseInt(rid));
    pstmt.executeUpdate();
    }I have got 35 fields in my db. But I wanna edit 34 fields only. I have no primary key in my table. Is't alright?
    pls help me.
    With thanks,
    WTDAHL

    I presume you are using SQL server, hence the [Date] in your SQL?
    I counted 34 question marks in your SQL statement, And 34 parameters supplied.
    Looks ok to me.
    You say you have no primary key? What is RegistrationId then?
    My suggestion for debugging: start smaller.
    Try updating it with only 5 fields, then 10 then 15 and build it up like that.
    Trying to debug 35 fields is a nightmare - you have to break it down to solve it.
    Good luck,
    evnafets

  • Hi,  I backed up my ipad and iphone on the same computer, will it be shown on the same folder or different? Mine is window 7, try to find the back up file follow the step that apple provided, it shown only iphone instead of ipad. Pls help.

    I backed up my ipad and iphone on the same computer, will it be shown on the same folder or different? Mine is window 7, try to find the back up file follow the step that apple provided, it shown only iphone instead of ipad. Pls help.

    What do you see under Edit > Preferences > Devices?
    tt2

  • TS3694 i factory unlock my iphone 3gs and was on ios 6.1.2 and updatednit to 6.1.3 with itunes and the phone got lock again at activation screen. i try downgrading to 4.1 with baseband 5.13.04 and want to upgrade back to 6.1.2. pls help me

    i factory unlock my iphone 3gs and was on ios 6.1.2 and updatednit to 6.1.3 with itunes and the phone got lock again at activation screen. i try downgrading to 4.1 with baseband 5.13.04 and want to upgrade back to 6.1.2. pls help me

    Sorry, downgrading the iOS is not supported by Apple, thus there is no official way to do so. Your phone was re-locked to the carrier it was originally locked to because you hacked it to unlock it. Apple's servers detected such & re-locked your phone. You need to contact the carrier your phone is locked to if you want to get it officially unlocked.

  • Hey there, whenever i try to start iTunes in my laptop amsg coming up saying : data execution prevention prevented iTunes from starting (Dep), would you Pls help me out.I have windows vista installed.

    hey there, whenever i try to start iTunes in my laptop amsg coming up saying : data execution prevention prevented iTunes from starting (Dep), would you Pls help me out.I have windows vista installed.

    No, i do not have quickTime player.
    I have tried to close dep off for iTunes but failed to do so as i got a msg that iTunes can't work without Dep in execution data prevention.

  • HT4098 I just fill in my credit card to purchase in games but always pls contact itune support, i try to but its hard to change my cc data in it,pls help me,tks

    I just fill in my credit card to purchase in games but always pls contact itune support, i try to but its hard to change my cc data in it,pls help me,tks

    When you get the message to contact iTunes support, that is what you have to do. There is nobody here that can help you, as it must be some issue with your account or credit card that only an Apple employee can help you with.
    Do as instructed in the message and contact iTunes Support. You can start here. Change to your own country if needed by tapping on the link in the upper right corner of this website.
    http://www.apple.com/emea/support/itunes/contact.html

  • HT1212 i forgot my password then its block when, i restore to technician of cellphone there's appear to to insert  my apple.id but i forgot it too what can i do to restore my i phone pls help me

    i forgot my password then its block when, i restore to technician of cellphone there's appear to to insert  my apple.id but i forgot it too what can i do to restore my i phone pls help me

    https://iforgot.apple.com/password/verify/appleid

  • I forgot my pass code on iphone i tried to restore it but it said you shoud turn off find my iphone i try on icloud but my location service is still on so i cant delet find my iphone pls pls help me

    i forgot my pass code on i phone
    i tried to restore it but it said you should turn off find my i phone
    i try on icloud to delete find my iphone
    but my location service is still on so i cant delet find my iphone pls pls help me

    Follow these instructions to remotely remove Find My iPhone from your device:
    Make sure the device is powered on and connected to a Wi-Fi or cellular network. Then follow these steps:
    Sign in to iCloud account at www.icloud.com/find.
    Click All Devices to open a list of devices linked to your account, then select the device to be removed.
    Click the Erase button to erase all content and settings from the device. When prompted, don't enter a phone number or message. Click Next until the device is erased.
    When the erase is complete, click "Remove from Account" to remove the device from the account.
    After the device is erased and removed from the account, you can proceed with the device setup process.
    Cheers,
    GB

  • When I try to update, I received "Download Error". Can NOT "Reload Applications" on Creative Cloud? Pls help. Thx

    When I try to update, I received "Download Error". Can NOT "Reload Applications" on Creative Cloud? Pls help. Thx

    Hello,
    could you already study these links:
    https://helpx.adobe.com/creative-cloud/kb/troubleshoot-cc-installation-download.html and
    https://helpx.adobe.com/creative-cloud/help/install-apps.html
    They should solve your problems,
    Hans-Günter

  • I have an existing ipod that I use with my mac. I am trying to connect an additional ipod to it but when I try and register, it just brings up the existing info. I don't want to lose the original info or library - just create new for this device. Pls help

    I have an existing ipod that I use with my mac. I am trying to connect an additional ipod to it but when I try and register, it just brings up the existing info. I don't want to lose the original info or library - just create new for this device. Pls help...

    We are starting from the beginning like its a new ipod starts out asking language, country,location services,choose a network,and when we get to "setup ipod touch  " there are 3 options 1..setup as new ipod, 2.restore from ipod backup 3 restore from itunes backup and when we hit setup as new ipod and click next it comes up with sign in with apple id or create a free apple id  we clicked create a free apple id....then comes up with bday,1st name last name, use your current email address, get a free icloud email address or change email address and THIS is where we have problems....if we hit change email address it means that sis's stuff goes under his name and moves all her stuff to this older ipod which the brother does not want. sorry this is so long but its the only way I knew to do it.

  • I can't update/downloads an app from app store by using by iphone 4s. The icon will change to blank keep waiting, this problem was trouble me for 1 week. pls help me.I try all the method (reset/change date setting)no help my network is ok.

    I can not update/download an app from app store by using my iphone 4s. I try every method by re-setting date/time and reboot the phone etc.NO Help.
    The icon will change to blank keep waiting & can not go in & use in. Anyone have solution for this. pls help me...tks

    .local indicates local activity by the computer host Williams-macbook-pro.local=hostname@domain . The UID of 501 is the standard UID of a local computer administrator.
    Copy and paste this little script in your terminal:
    if [ "SSH_CONNECTION ]; then
         echo I am remote
    else
         echo I am local
    fi
    A return of "i am local" ensures there is no remote connection to your machine (through SSH).
    In the future, to avoid remote entry, I would recommend not posting your IP address though.

  • I try to do simplest thing  in bi but  i failed.  pls help.

    Hi,
    I have a quesiton regarding to security . This is a very basic question and related to a base security feature of Bı. But it doesn't work here.
    My version is obiee 11g. Here is what i try to achive:
    I have created a new user called userA. I put this into the BICOnsumer group so it can run analysis.
    Then in order to userA run an analysis, i log into another user, choose a sample report called reportA , and give full control to userA. ( i also tried other rights)
    Since reportA is stored in folderA , i also give full rights for folderA to userA.
    Now what i expect to see is , if i login with userA , i can open the folderA and see, run the reportA.
    But: although i can open folderA , i can't see the reportA. Very simple thing i think , but it doesn't run .
    And
    Pls help.

    Hi,
    Have you check catalog -->folder A-->
    permission --> add it user A then try log in it will show to userA
    Also make sure below steps also
    Go -- settings manage dashboard access add it user A then it should work
    Thanks
    Deva
    Edited by: Devarasu on Sep 16, 2011 6:19 AM

  • HT4489 Hi all, I have .vcf contact file exported from yahoo and need to import it to cloud. When I try to import it I get an eror "53 contacts not imported, eror reading vCards". Pls help ty

    Hi all, I have .vcf contact file exported from yahoo and need to import it to cloud. When I try to import it I get an eror "53 contacts not imported, eror reading vCards". Pls help ty

    1 - Select  the thumbnail of one of the problem photos and use the File ➙ Reveal in Finder ➙ Original menu option.  This will take you to the folder containing the original file with that file selected by the Finder. 
    You can also use Find Any File to search for that file (get the file name from the Info pane in iPhoto). You will find the thumbnail version and maybe an edited version also.  Made sure what is found is the large, original version and note were it's located.  Search all of your drives with FAF just in case.
    If you don't fine the full sized version then the only recourse is to use a file recovery application like   SubrosaSoft FileSalvage on your drives to see if any of your full sized photos can be recovered.   If you find enough files to make the purchase of the software worthwhile buy it and recover the files.  However, since it may have been quite a while since you discovered the missing originals it seems unlikely you'll be able to recover any due to being overwritten.
    2 - book projects are just entries in the library databases and can't be exported to another library. 

Maybe you are looking for