• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating a new postgresql database from java application

 
Nathalie Monvoisin
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i'm trying to create a new postgresql database from my java application, and i am having this Error message.

"Error executing: Create Database student
. Cause: org.postgresql.util.PSQLException: ERROR: CREATE DATABASE cannot run inside a transaction block"

can anyone help
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error pretty says it all, create database shouldn't be run inside a transaction?

Why need a transaction in the first place in your situation?
 
Nathalie Monvoisin
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to create a database from my java application and it is giving me this error
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you setting up the JDBC connection and running the sql?
 
Nathalie Monvoisin
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my database is connected to my java application, i ask the user for a database name. Then the database is created using that database name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic