aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Creating Databases and Roles from Enterprise Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Creating Databases and Roles from Enterprise Application" Watch "Creating Databases and Roles from Enterprise Application" New topic
Author

Creating Databases and Roles from Enterprise Application

Marembo Ochieng'
Greenhorn

Joined: Sep 12, 2009
Posts: 19
Hi all;

Am Trying to create a database and user roles from an enterprise application but to no avail.
The following exception is overthrown

the code is as follows

any help will really be appreaciated



Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Holy moly that's a lot of error. I didn't read every line but I didn't see any explanation of a database / sql error. How about trying your SQL in a simple main() test? You may be able to get a better explanation of the problem (SQL error, wrong privileges error, etc). Or may be the error is not a SQL error at all.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30772
    
156

Marembo,
Many (or all) databases do not allow you to create a database via JDBC. Try it using Runtime.exec to run at the command line.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Marembo Ochieng'
Greenhorn

Joined: Sep 12, 2009
Posts: 19
thank you guys, actually doing it as a process command will help, its only that now i'll have to know what type of database the client will be using-but thats a lot easier.

However, i want to use two datasources in the same ejb-unit; viz:



is this possible, because it is not working apparently.

Thanks guys.
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
Yes we can use two Datasources in a way you are using. What is not working out for you?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating Databases and Roles from Enterprise Application