db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oystein.Grov...@Sun.COM (Øystein Grøvlen)
Subject Re: Automatic database and schema creation
Date Mon, 25 Apr 2005 08:27:36 GMT
>>>>> "ØG" == Øystein Grøvlen <- Sun Norway <Oystein.Grovlen@Sun.COM>>

    ØG> Peter Nabbefeld wrote:
    >> Hello,

    >> I just want to create a database, if it does not yet exist. Database
    >> creation works,  schema creation does  not. I'm using  the following
    >> syntax (in Java):

    >> Statement stmt = con.createStatement();

    >> stmt.execute("CREATE SCHEMA USER");
    >> The result is an SQLException with SQLState = 42X01 (Syntax error).

    >> What  am I  doing wrong?  Before creation,  I'm trying  to  insert a
    >> record. If  an Exception is thrown,  I ask for  status 42Y07 (Schema
    >> does not exist). Derby is stable version (


    ØG> USER  is a  reserved word.  I think  it would  be nice  if  the error
    ØG> message reflected that.

When I tried this myself in the embedded configuration, I got:

     ERROR 42X01: Syntax error: Encountered "user" at line 1, column 15.

which should give you a hint of what the problem is.  Is it possible
to change the message to "Encountered reserved word "user" at ..."?


View raw message