• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Creating Databases and Roles from Enterprise Application

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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



 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 42135
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marembo Ochieng'
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes we can use two Datasources in a way you are using. What is not working out for you?
 
reply
    Bookmark Topic Watch Topic
  • New Topic