-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate in Swing Application (username, password)
PostPosted: Sat Jan 08, 2005 1:53 pm 
Newbie

Joined: Mon Sep 06, 2004 1:39 pm
Posts: 18
Location: Utah, USA
Hibernate version: 2.1.6

Name and version of the database you are using: MySQL

I have written a swing application that uses hibernate to connect to a MySQL database. The application is used to interface with a database that powers a web application and automatically prints things. The application is loaded via Java WebStart.

My question is about the hibernate mapping file. Right now when I create the JAR file for the program I am including the hibernate.cfg.xml in the JAR. This file has the username and password build in to it. Since the JAR is nothing more than a zip file anyone with a little Java knowledge could open the jar and obtain a username and password.

Is there a way to replace hibernate.cfg.xml with a compiled class? Is there another more appropriate way to handle this?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 08, 2005 2:28 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
For what its worth, you can obfuscate this by setting up your Configuration object and SessionFactory programatically. This is documented.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 08, 2005 2:29 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Or use startup properties.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.