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
|
|