-->
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: problem to create tablespace using hibernate
PostPosted: Wed Jan 12, 2005 6:02 am 
Newbie

Joined: Fri Nov 19, 2004 12:17 am
Posts: 5
Hi all,
I am trying to create the database user and tablespace using application. I am connecting to the database using a username which have DBA previlage.
I am able to create user and tablespace using the JDBC when i am connecting to database using the username which have DBA previlage.

OracleDataSource ods = new OracleDataSource();

ods.setNetworkProtocol("tcp");
ods.setUser("oamadmin");
ods.setPassword("oamadmin");
ods.setURL("jdbc:oracle:oci:@qatestmachine:1521/ORCL");
Connection conn = ods.getConnection();
Statement stmt=conn.createStatement();
String sql="CREATE SMALLFILE TABLESPACE \"ORA02\" DATAFILE \'C:\\ORACLE\\ORADATA\\ORCL\\ora02\' SIZE 50M AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ";
stmt.executeUpdate(sql);
stmt.close();

This code is working fine.

when i am getting the JDBC Connection from hibernate session and try to execute the same code Statement is created but executeUpdate method giving exception.

Pls tell me why it is happening or is there any other way to create tablespace and user.

Regards
Ajay


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 7:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Pretty much impossible to answer without you telling what exception occurs and where.


Top
 Profile  
 
 Post subject: problem in save query on different tablespace
PostPosted: Wed Jan 12, 2005 8:37 am 
Newbie

Joined: Fri Nov 19, 2004 12:17 am
Posts: 5
now its working fine.

now the another problem is when i am querying to the different table space in oracle.
the select query is working fine but in the save query i am getting message

table or view not found.

In this application i am using

hibernate.dialect net.sf.hibernate.dialect.OracleDialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username oamadmin
hibernate.connection.password oamadmin
hibernate.connection.url jdbc:oracle:oci:@//qatestmachine:1521/ORCL
hibernate.show_sql true
hibernate.default_schema scott

oamadmin user have grant of DBA and scott is working on table space SYSTEM.

when i have select query it is making the call to the SYSTEM tablespace but when i am sending the save query it is making call on the oamadmin's default tablespace.
update and delete is also working fine
what is the problem.

Regards
Ajay


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.