Engywook88 Frequent Contributor.
Frequent Contributor.
295 views

Using JDBC driver to "CREATE USER" on Oracle DB

Hi everyone,

I'm new to this forum and I need your help . My problem is that i have to integrate the NetIQ product with a DB oracle on which i have to create new users and assign them grants. I ask you, for the creation user part, if it is possible to use just the "CREATE USER" statement or if the driver fails to interface with the Oracle engine and therefore i have to use "INSERT" on specific Oracle Tables.

 

Thanks in advance for your support

P.S. Sorry for my English

Labels (1)
Tags (3)
9 Replies
Micro Focus Expert
Micro Focus Expert

Re: Using JDBC driver to "CREATE USER" on Oracle DB

0 Likes
Knowledge Partner
Knowledge Partner

Re: Using JDBC driver to "CREATE USER" on Oracle DB

Every DB is pretty much different.  Some DB's do actually have constructs called Users (for logging into the DB itself).  Most applications 'make' their own users inside the tables for their database.

That is, ask your application owner, what a user should look like, and more specifically if they could provide an example SQL statement to make a user the way they want.

Then using Norberts link to the docs you can build a SQL statement to match and use IDM features to get the data needed inside the statement.

Or you could try and map the table to user class, and map the attributes to the rows if that would work.

0 Likes
Engywook88 Frequent Contributor.
Frequent Contributor.

Re: Using JDBC driver to "CREATE USER" on Oracle DB

We have Oracle DB version 12.1c. Talking to the DBA he told me that for the user creation the only statements he uses are CREATE USER, ALTER USER and GRANT without any INSERT. So, i hope that if the driver can use these statement without knowing the structure of the DB it will be a simple integration.

0 Likes
Knowledge Partner
Knowledge Partner

Re: Using JDBC driver to "CREATE USER" on Oracle DB

The out of the box version of the driver should work with that.

You don't write any SQL code in the driver at all if you don't want to.

But if it doesn't work, you can write SQL code as Norbert wrote about to enhance the functionality or to bypass something.

0 Likes
Knowledge Partner
Knowledge Partner

Re: Using JDBC driver to "CREATE USER" on Oracle DB

In fact I think that the CREATE USER is mapped through directly.  There is a default package I think that provides this functionality.

 

0 Likes
Knowledge Partner
Knowledge Partner

Re: Using JDBC driver to "CREATE USER" on Oracle DB

Exactly,
That was what I meant. In most cases standard actions are mapped straight through. The standard packages is good in this way for everyone who doesnt speak sql.
0 Likes
Engywook88 Frequent Contributor.
Frequent Contributor.

Re: Using JDBC driver to "CREATE USER" on Oracle DB

Sorry again, but i'm al bit confused. In the link posted by Norbert i see that in the statement type (methods-for-executing-sql-statements) is not present the CREATE USER / ALTER statement. I'm able to pass this statement in a query or what ?

"Generally, it is not possible to run a Data Definition Language (DDL) statement in a database trigger
because most databases do not allow mixed DML and DDL transactions. Although virtual triggers do
not overcome this transactional limitation, they do allow DDL statements to be executed as a side
effect of an XDS event."

P.S. I remind you that I don't know the DB schema.

Thanks in advice.

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Using JDBC driver to "CREATE USER" on Oracle DB

0 Likes
Engywook88 Frequent Contributor.
Frequent Contributor.

Re: Using JDBC driver to "CREATE USER" on Oracle DB

The code above the sql statement is necessary to complete the creation of the user and activate the trigger? Or i can simple use:

<jdbc:statement>
        <jdbc:sql>CREATE USER jdoe IDENTIFIED BY novell></jdbc:sql>
</jdbc:statement>

 

Andrea

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.