Netbeans database password change

I have moved a netbeans project from one computer to another.  Everything is being recognized properly but when I run the project in net beans I get the error saying

Access Denied for user 'auction'@'localhost' (User password: Yes)

I imagine somewhere in a file netbeans has the username for the database.  I need to be able to change it as there is no user name of 'auction' on the new computer.  The user name 'auction' is what was used on the computer the project and database came from.  Thanks!

Cheers - Al
sargent240Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bruce SmithSoftware Engineer IICommented:
What kind of project is it? It will probably be in the Run Configuration settings or the web.xml file. More than likely web.xml file.
sargent240Author Commented:
It is not a web application.  It is a java application
sargent240Author Commented:
Sorry, It is not a web.
Expert Spotlight: Joe Anderson (DatabaseMX)

We’ve posted a new Expert Spotlight!  Joe Anderson (DatabaseMX) has been on Experts Exchange since 2006. Learn more about this database architect, guitar aficionado, and Microsoft MVP.

sargent240Author Commented:
I have two xml files on the computer.  Looking in each on, they contain the number 60 and that is all that is there.  Any Ideas, Thanks.
Bruce SmithSoftware Engineer IICommented:
Okay, then it will not be in an xml file. The password could be located in one of the classes or it could be located in the properties of a pre-configured database. You can view the pre-configured services databases and by right-clicking on them, you can view their properties. Here is where that will be:
 Services in NetBeans
If it's not a pre-configured services database  I would suggest downloading JEdit (http://www.jedit.org/index.php?page=download) as you can search within all files/classes of the directory of your project for the word "auction" so you can replace it with your new username.
sargent240Author Commented:
If I go to the spot you are suggesting

     jdbc:mysql://localhost:3306/music[root on Default Scema]

and right click and select properties the fifth item from the top of the properties box says.

    User             root

and root is greyed out.  I see no reference to 'auction'.
Bruce SmithSoftware Engineer IICommented:
So there error is coming from somewhere else then. I am assuming that you have a connection string in one of your classes that contains the username of "auction". Search in your classes for some lines of code that might look something like:
 
Class.forName("com.mysql.jdbc.Driver");
con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/music", "auction", "somePassword");

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sargent240Author Commented:
can I search the entire project for the word auction
Bruce SmithSoftware Engineer IICommented:
Yes,

Edit-->Find In Projects...


nb.png
Bruce SmithSoftware Engineer IICommented:
In the output at the bottom it will tell you in what file/class the word "auction" is located in and what line of code as well.
sargent240Author Commented:
I think I found what I need in persistence.xml.  Can I just edit the file?
sargent240Author Commented:
Bingo my friend.  I edited the persistence.xml file to reflect the new user and it worked.  Thank you for your help and have a Merry Christmas.
Cheers!
Bruce SmithSoftware Engineer IICommented:
You're welcome. You too!
sargent240Author Commented:
First class help on Christmas Eve.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.