How do i hide the password in my jdbc connection?

I just want to ask how to hide my password in my jdbc connection because when someone decompile my class and read my code, he can change the content of my database. I want to know the steps behind it.
my code goes like this
DriverManager.getConnection("jdbc:mysql://localhost/fruits", "admin", "3xmrk");

i opened a notepad and write my jdbc properties and save it as database.properties.
and i tried to test it with the following code but i get a null pointer exception... is my way of creating .properties file is wrong??
import java.util.*;
import java.io.*;
public class Testing2
     public Testing2()
          Properties props = new Properties();
          try
               InputStream in = getClass().getResourceAsStream("database.properties);
               if (in == null)
                    throw new NullPointerException("Could not find database.properties");
               props.load(in);
          catch (IOException e)
               throw new RuntimeException(
                    "Error loading dbservices.properties from classpath.", e);
          String dbUrl_ = props.getProperty("dbUrl");
          String dbLogin_ = props.getProperty("dbLogin");
          String dbPassword_ = props.getProperty("dbPassword");
     public static void main(String args[])
          new Testing2();
}

Similar Messages

  • How can I hide the password and user name in url???

    Hi experts,
    I'm creating a login page and know I have a problem.
    The Username and password are verified in a Java class, after checking the user and password, the user should be linked to the portal.
    So far everything has worked well.
    But when I call the lin like this
    res.sendRedirect ("/ irj / portal j_user =" + UserN + "& j_password =" + passw);
    then the user name and Pwasswort appears in the url.
    Can someone tell me how can I hide the password and user name???
    It will be very helpful.
    Thank you
    Edited by: Cilvaring on Aug 5, 2011 12:00 PM

    If there is no specific reason that you have to use sendredirect...thne you can try request.forward.....
    RequestDispatcher rd = request.getRequestDispatcher("pathToResource");
      rd.forward(request, response);

  • I have an issue with passwords when I first type them in any social or personal site, how can I hide the passwords when im typing so no one see them...

    Well the thing is that when I open any site that requires passwords everyone can see what I´m typing instead of appearing dots like in old version for example:
    username: littlegirl
    password: hjy --> this is what i dont want isntead of appearing words i want dots
    just after typing and entering dots appears where can i switch this?

    Hi,
    Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]. Safe mode disables the installed '''Extensions''', and themes ('''Appearance''') in '''Tools''' ('''Alt''' + '''T''') > '''Add-ons'''. Hardware acceleration is also temporarily disabled - the manual setting is '''Tools''' > '''Options''' > '''Advanced''' > '''General''' > [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Advanced%20panel?as=u '''Use hardware acceleration when available''']. All these settings/options/add-ons can also be individually or collectively disabled/enabled/changed in Firefox normal mode to check if an extension, theme, option or hardware acceleration is causing issues. Disabling/enabling hardware acceleration, and some types of add-ons in normal mode may require a Firefox restart.
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.org/en-US/kb/Options%20window Options]
    An easier method would be to consider the [https://support.mozilla.org/en-US/kb/reset-firefox-easily-fix-most-problems Reset Firefox] feature via '''Help''' ('''Alt''' + '''H''') > '''Troubleshooting Information'''.
    (To revert to the previous profile, close the new profile, start Firefox and choose the '''*.default''' profile. While the [https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles Profile Manager] is open, you can also delete the newly reset profile (the one containing random numbers)).
    [https://support.mozilla.org/en-US/kb/Managing-profiles Managing profiles]
    [https://support.mozilla.org/en-US/kb/Profiles?s=profile&r=2&e=sph&as=s Profiles Howto]

  • How can I reenter the password for my IP connection?

    Just got my new 4G iPod Touch, but when I went to connect to the internet, I had to enter my password. Unfortunately I must have entered it wrong, because while it shows that I am getting a signal, it will not allow me to connect to the internet. My old 2G is connected just fine, and the new one can connect to other wifi networks without passwords. My problem is that I don't see any way to reenter/change a password. Surely there is a way to do this?

    Sometimes you will find a Forget This Network button on the wifi page in setting. If that dos not owrk try Resetting Network Settings which is under Settings>General>Reset.

  • How to hide the password in .class file?

    Hi All,
    I try to use a Connect.java file to connect to MySQL. The URL is similar to the following:
    "jdbc:mysql://192.168.1.1/database?user=name&password=123456"
    When I compile the .java file to a .class file, I can still see the full URL line in the machine codes of the Connect.class file.
    How to avoid exposing the password in the line?
    Thank you.
    Anthony Pong

    1) Use obfuscate option in your Java compiler
    2) There is Jakarta tool BCEL - which can be used for
    obfuscation, etcObfuscation tools don't obfuscate single literal string contents, which is the problem here.
    You'll have to make sure that your string doesn't appear as a single string anywhere. One technique is to break up your password into pieces, and scatter the declarations around, and join them up in the code to construct your password.
    (Oh yeah, and don't call your variables "static private final String passwordPiece1="foo";" either :-), or use an obfuscation tool to hide these variable names).

  • How can we hide userid & password from browser

    How can we hide the userid,password and connectionstring from the address bar of explorer when we run 9i forms on browser

    Ok - I have 9.0.4 and I want to disable this hiding of password, as I have the follwing problem: Forms creates a temporary local file which contains javascript. Per default in xp service pack 2 it is not allowed to run javascript from local file. Is there any parameter in webforms.cfg to disabel the creation of this temporary file?

  • Hide the password "sqlplus log/pass"

    Hi,
    I am using the following command and running through the shell script.
    Unix Prompt> sqlplus abc/abc @sqlplus_settings.sql
    Now when I do ps -ef |grep abc. It shows me the username and password "abc".
    How can hide the password
    Thanks and regards
    KP
    null

    1. you could put the username/password as
    the first line of u're sqlscript.
    2. or use the following syntax in unix ksh
    sqlplus << END_OF_SQLPLUS_CMDS
    username/password
    @sqlplus_settings.sql
    END_OF_SQLPLUS_CMDS
    unfortunately the above ksh will exit once it executes sqlplus_setting.sql ..so is only useful for running batch scripts
    3. if u're purpose (as it seems from the name of u're script ) is to set some initial sql*plus settings like linesize ,pagesize etc...then try using login.sql SQL*Plus always looks for this script in the current dir or the ORACLE_PATH and runs it as it connects to a session.

  • How do I change the password on my IPhone?

    How do I change the password on my IPhone?  I am using a card that belonged to my former daughter in law and I cannot get the original password.  I need it to change the Restrictions setting because all of a sudden my ITunes apps won't download when I sync my phone....just photos and music.  Apps list is "grayed" out. 

    No, not on the home screen.  I clicked on Settings + Restrictions (which is set at "Yes" and I need to change it to "No") and the number pad came up and wanted the password.  My son says its the password that was put on originally when the phone was new (by his ex-wife who owned the phone at the time.)  So now I cannot retrieve the original password from her and cannot change the Restrictions setting and therefore, cannot fix my ITunes/Apps problem.  So aggravating!  But thanks for your response!

  • How can I change the password in the iBook donated to our nonprofit.  No password was given with the iBook?  We need to put in printer and other software.  Help, we can use the laptop without changing the password.

      How can we change the password in the iBook donated to our nonprofit?  No password was given with the iBook and every time we try to install items, the password window pops up.  We need to put in printer and other software.  Help! We can use the laptop without changing the password.

    If you did not get an OS X install-restore DVD with the computer you may need
    to buy one from somewhere, and you may be lucky to get a retail OS X 10.5.x
    version. The original grey-label install set of software and OS X it shipped with
    likely would be an older system than Leopard 10.5. Last versions of G4 Mac, &
    G5, shipped with a Tiger 10.4 system; so did early Intel-based Mac. Grey discs
    which accompanied other computer build models generally do not interchange.
    The last OS X version a PowerPC architecture can use, if supported, is 10.5.8.
    A PPC processor at 867MHz & faster should be able to run OS X 10.5 Leopard.
    {With the correct disc installer, you can use it to change a password and other
    things including re-install, and perform disk utility functions, etc.}
    There is a chance you may be able to get a white-label Replacement 10.4 DVD
    or Replacement 10.5 DVD from AppleCare or the online Apple Store (800myapple)
    from a Mac OS X system specialist; these have been available yet hard to get
    as not all persons involved with them seem to know if they still exist until someone
    is asking. These aren't retail stock, are special discs for computers who could use
    a system later than original old discs; these are complete install discs not for one
    specific series of Mac. Generally they'd work in supported PowerPC G4/G5; but
    do not replace specialized original install DVD, such as an early Intel mac requires.
    You'd need to have a serial number of the computer, and a method of payment
    when seeking some replacement system media from Applecare or Apple sales
    and these discs are not available in a retail store. The original Retail discs are
    labeled differently and shipped in a retail box with a big X on the front. Other
    sources for retail 10.4 Tiger or 10.5 Leopard may be online via amazon sellers
    or computer resellers who handle repaired Macs. Avoid mystery grey label ones
    that were intended to be sold and kept with their original computer kits.
    Good luck!

  • How can I hide the class file ??

    Hi !
    I has a question, when i write a program of Java, then use the command "javac" to compiler to class file for other people using, but the class file can be disassembled and convert to source code. How can I hide the class file and let people can not disassemble, or can not see the source code. Thinks

    See these....
    http://www.saffeine.com/
    http://www.jarsafe.com/
    I recently read this. This will help you.
    http://developer.java.sun.com/developer/qow/archive/160/index.jsp
    Enojy....
    Rajesh

  • How do I reset the password that allows me to download reader - I worked with chat help - we rest my password and I can get into my adobe account but when I try to download reader and work my way through the process when I get to the password it will not

    How do I reset the password that allows me to download reader.. I worked with chat help two hours last night - we have reset a password that lets me into my adobe account but in the download reader process that password will not work - where it says Adobe reader wants to change something and please type in password, just vibrates with the dots glowing purple but will not open…. what do I do to reset that password or get it to function. they would not assist me further they said its a free download and I would need to seek help from forums ( all this is new to me )
    so "forums" help…what do I do ?
    thank you
    PL

    patricia here again:
    I am the system administrator - personal computer
    I have been able with your lead to find the password I need , and to have install happen
    however - when I then go to the website to download the Pdf document I need I get a screen with the big red adobe icon that says to complete and down load this document I must launch adobe reader a dn sign the terms of agreement , close browser and reopen.
    but thatscren has no choice buttons whatsoever, I cannot find anywhere a adobe reader image to launch - been into launch pad , preferences etc.
    so now the loop is the pdf document and the adobe screen saying I must do terms of agreement
    like is this Kafka like or what ...
    suggestions?
    thanks
    P.

  • I have forgotten my Password to be able to connect between my desktop Mac and Mac Book on my home network. How can I recover the password or change it?

    I have forgotten my Password to be able to connect between my desktop Mac and Mac Book on my home network. How can I recover the password or change it?

    The password used to log in to a user account remotely is the same as you would use to log into it locally. You can also use your Apple ID, so try that.
    To change your login password read OS X Mavericks: Reset a login password
    also OS X Mavericks: If you forget your login password

  • I have just acquired an iMac desktop. I want to sign on to my airport wireless network, but cannot remember the password. How can I access the password or reset it. I already use a MacBook Pro and an iPad on the network.

    I have just acquired an iMac desktop (about 4 years old). I want to connect to my Apple airport wireless network, but cannot remember the password. How can I access the password or, if necessary, reset it. I already use a MacBook Pro and an iPad on the network and don't want to jeopardize what already works well. I am not all that computer literate.

    How can I access the password or, if necessary, reset it.
    Read the user manual that came w/your Airport router or you can cross-post in one of the  AirPort Forums for instructions. 

  • I gave my father a mini ipad and he forgot the icloud password and the e mail for recovering it.  How can I recover the password or create a new one if I have no idea at all of the info he configurated.?? ;(

    I gave my father a mini ipad and he forgot the icloud password and the e mail for recovering it.  How can I recover the password or create a new one if I have no idea at all of the info he configurated.?? ;(

    He will have to contact Apple and speak to someone in account security if he can't recover it at https://iforgot.apple.com/appleid

  • I forgot my password to get inot email on Thunderbird. How do I retrieve the password or set a new one?

    When I ttry to get my email through Thunderbird, it is now asking me for my password, but I have forgotten it, it has been so long since I have been asked for it. How do I retrieve the password, or set a new one?
    YOU CANNOT EMAIL ME MY ANSWER SINCE I CANNOT OPEN MY EMAIL. CALL at 240-305-7128 or email at [email protected]
    == This happened ==
    Every time Firefox opened
    == yesterday

    You need to go to the website of your email provider, only there can you change your password, or let them send you a new one to a different address. Thunderbird can't help you with that.

Maybe you are looking for

  • How to print report in Charactor mode using Oracle Developer 10g

    Dear, I have converted my few reports from Oracle Developer forms 5 to Oracle Developer forms 10g, i am running these reports on Web, for that i have configour "rwserver" server. But when i run these report through menu on Web i got error message lik

  • Autonomous database transaction

    Hello, I'll log some application information in a local table like this: Here a pseudocode example: funktion mainFunction{   "INSERT something"   log(count of inserted rows).   do something other   on error COMMIT eles ROLLBACK function log(message){

  • Max HDD Size for Satellite 3000 -514 with BIOS 2.30

    Hi folks ! What is the largest HD size notebook recognizes with BIOS 2.30. I found no FAQ information ragarding this BIOS version. Thx for your help.

  • Chapter Select; link to chapters will not play video!

    Please help!!!! I am desperate - have been at this for weeks now. I am trying to create a Chapter Select menu separate from my main menu. Okay, I did it; made a main menu and a chapter select menu through photoshop and the buttons work fine. When you

  • Photos are hidden how do I make the visible again?

    I wanted to delete a picture when ordering a collage mug from Walgreens. I hit a button that said "block or hide" pictures. It hid ALL pictures and now I'm not able to get any of them back