File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Database newbie question about logging in Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Database newbie question about logging in" Watch "Database newbie question about logging in" New topic
Author

Database newbie question about logging in

Steli Niculescu
Greenhorn

Joined: Jul 14, 2009
Posts: 14
I have a task for an internship interview : a small JDBC application that uses an Oracle database. I have to send it to the interviewer to review it.
My code connects to my local testing Oracle XE database using user/pass "system"/"system" (that's the password i defined).

If I export the application into a JAR and send it, it will surely not work on the reviewer's machine because he probably has a different password
for the "system" user, and he will have to modify the code.

Is there a universal user (or something like this) for the Oracle database, for which i'm not required a password defined by me?

Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2497
    
    8

Is there a universal user (or something like this) for the Oracle database, for which i'm not required a password defined by me?
No - and I am quite happy about that. It would be a major security breach.
It is also not advisable to use the Oracle System user in your application.
SYSTEM is a privileged administration user



You have several options:

- Ask the interviewer what the name and password and connection details of his database will be
- Use a configuration file, and provide the interviewer with instructions on how to set the parameters
- Create a login form that requests for this info.


OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database newbie question about logging in