user « Database « JPA Q&A





1. Is it possible for hibernate to create the database and database user?    stackoverflow.com

I have an application that uses hibernate and JPA to handle the database. I know that hibernate can create the database tables for me, however, I've found that I must first ...

2. matching user's password from record in db    stackoverflow.com

In my web app which uses servlets and hibernate. I need to authenticate a Customer who enters a password. If he is already in database, I need to check if his ...

3. Modeling User Roles Hibernate    stackoverflow.com

Just a design question. I have a entity essentially a user type who is a Therapist. The therapist is able to log on to the system as a user and perform ...

4. Hibernate database user privileges    coderanch.com

Hi all, I'm using Hibernate in my application which is about to go into production. Can anyone provide any guidance as to the recommended privileges the user that Hibernate connects to the database should have? At the moment we are using this script on our mysql database: create my_database; use my_database; grant all privileges on *.* to hibernate_user@localhost identified by 'mypass'; ...

5. Connect to the same DB by different users using JPA    forum.hibernate.org

Hi, I looked everywhere for solution of my issue but unfortunatelly didn't find it. Ok, I have hibernate, spring, oracle. I have DB and many users who use this DB. This database is made in the way that users see only allowed to them information. Each user has its own username/password. I'm trying to build spring based hibernate JPA application which ...

6. Hibernate - taking database name as user input...    forum.hibernate.org

Hello, I have worked in hibernate for one database only. I am working on a project, where the database name will be taken as input from user. The user will then be allowed to work with that database. Though the database name will be taken as input, all database will be having same schema architecture...So one cfg.xml will help... I learnt ...

7. DB2 users...    forum.hibernate.org

rownumber() over() as row_ makes every row distinct. That being said, I don't think I can use FirstResults for queries with distinct. Since I need only the first x rows of the report, which doesn't translate into x rows of the result set. Dammit. Anyway, I'd just put a bugaboo in the docs to let people know that this may not ...

8. multiple database with multiple database users    forum.hibernate.org

9. database that depends on the user    forum.hibernate.org

Yes this is very possible. What is your environment? Are you using JBoss or just standalone Hibernate? You will need to have seperate configurations (xml or properties files) for each database that you will be using. For each of these configurations you will generate a SessionFactory that could be stored into a Map with some key. When your user executes a ...





10. Need to define Custom User Type for Multiple Databases    forum.hibernate.org

This is my first post and I want to thanks Hibernate Team for a greate tool. I'm learning now but I will try to contribute as much as I can, for the moment I have a question to ask: Im dealing with legacy database and I have all columns defined as CHAR SQL datatype. Reading this Forum I found that the ...

11. Handling of database user accounts    forum.hibernate.org

Hibernate version: 3.0.5 Name and version of the database you are using: PostgreSQL 7.4.8 Hi there, So far I am initializing hibernate using a configuration file where I specify all connection details and mapping documents. In the need for creating a login screen (which will actually use the login information of the database), I'm trying to find out whether this is ...

12. How can I use two database user with hibernate    forum.hibernate.org

13. using more than one database user with connecion to database    forum.hibernate.org

Hello, I have problem with using more than one database user with connecion to database. I want to connect to my database using more then one user. Everywhere in examples and in doc there is use only one user to connect to database, for example defined in hibernate.properties (or in xml) file: hibernate.connection.username = myuser We have a SessionFactory object which ...

14. One user -> One database login with Hibernate ?    forum.hibernate.org

15. Propagate user accounts to database    forum.hibernate.org

I am using a 3 tier application: presentation layer service layer DAO layer My application's users are authenticated to an LDAP. My database can accept these users because it authenticates to the same LDAP. Currently my application uses a single (super) user on the database, defined in the datasource configuration. However my application should propagate the real users to the database, ...

16. Different database users    forum.hibernate.org

Hello all, I am facing a situation where there is a existing database directly accessed by different users and they one to migrate the system to Hibernate. This is done like it is because they can control which user does whatever thing at any moment. What would be the best practice to follow? We are open to ideas. Should we keep ...





17. Database user and password logging    forum.hibernate.org

18. change user and password to connect db using hibernate    forum.hibernate.org

Hi, i have this problem, i want to connect to database using differents users name and password, i try to chage it at run time with this code: Properties prop = cfg.getProperties(); prop.put("hibernate.connection.password",pass); prop.put("hibernate.connection.username",usr); cfg.getProperties().clear(); cfg.setProperties(prop); sessionFactory = cfg.buildSessionFactory(); but when sessionFactory is created it still have the old user name and pass (same in hibernate.cfg.xml) Please someone help me.

19. Hibernate with multiple users(databases) ???    forum.hibernate.org

In oracle, a user is considered a schema. So for example if you connect as user "user1" and you specify hibernate.default_schema="user2" all your tables will be qualified with user2. SELECT * from tablename... would become SELECT * from user2.tablename... for example. I think with hibernate you can only define 1 default schema. If you want to read tables from multiple users ...

21. Callind DB2/UDB user defined function    forum.hibernate.org

Hi, I'm not sure how to call a db2/udb user defined function. Here's the code for the function: CREATE FUNCTION ABC.getEmployees( departmentid_in INTEGER ) RETURNS TABLE (EMPLOYEEID INTEGER,DEPARTMENTID INTEGER,LASTNAME VARCHAR(40),FIRSTNAME VARCHAR(40),EMPLOYEECODE VARCHAR(10)) ------------------------------------------------------------------------ -- SQL UDF (Table) ------------------------------------------------------------------------ F1: BEGIN ATOMIC RETURN SELECT * FROM ABC.EMPLOYEE AS EMPLOYEE WHERE EMPLOYEE.DEPARTMENTID = getEmployees.departmentid_in; END The mapping file:

22. get user from database    forum.hibernate.org

Hello everyone, I need to get an User object from my database based on user and password Strings. I finally got it working this way: Code: public User getUser(String login, String password) throws InfrastructureException { Session session = HibernateUtil.getSession(); User ...