Question:

I tried to create a Database User using my Java application. Below is my code.

     try {
       UserManager userManager = new FBUserManager();
       userManager.setHost("localhost");
       userManager.setPort(3050);
       userManager.setUser("SYSDBA");
       userManager.setPassword("masterkey");

       User user = new FBUser ();
       user.setUserName("TESTUSER");
       user.setPassword("1");
       user.setFirstName("John");
       user.setMiddleName("W");
       user.setLastName("Doe");

       userManager.add(user);

     } catch (Exception e) {
         e.printStackTrace();
     }
}

I have used "FBUserManager" and "FBUser" in order to create a new user. When I execute the above code, I get an error. Please refer to the following stack:

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 15. No message for code 15 found.
 at org.firebirdsql.management.FBUserManager.userAction(FBUserManager.java:240)
 at org.firebirdsql.management.FBUserManager.add(FBUserManager.java:254)
 at com.PNA.INPP.InppFBDriver.addUser(InppFBDriver.java:621)
 at com.PNA.INPP.InppDBCreation.addUser(InppDBCreation.java:225)
 at com.PNA.INPP.InppDBCreation.buildINPDatabase(InppDBCreation.java:288)
 at com.PNA.INPP.InppDBConnection.isInpDBConnect(InppDBConnection.java:243)
 at com.PNA.INPP.InppDBConnection.isCreateDBConnections(InppDBConnection.java:356)
 at com.PNA.INPP.InppMain.main(InppMain.java:151)
at org.firebirdsql.gds.GDSException: No message for code 15 found.
 at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2791)
 at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2743)
 at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscServiceStart(AbstractJavaGDSImpl.java:2910)
 at org.firebirdsql.management.FBUserManager.userAction(FBUserManager.java:232)
 at org.firebirdsql.management.FBUserManager.add(FBUserManager.java:254)
 at com.PNA.INPP.InppFBDriver.addUser(InppFBDriver.java:621)
 at com.PNA.INPP.InppDBCreation.addUser(InppDBCreation.java:225)
 at com.PNA.INPP.InppDBCreation.buildINPDatabase(InppDBCreation.java:288)
 at com.PNA.INPP.InppDBConnection.isInpDBConnect(InppDBConnection.java:243)
 at com.PNA.INPP.InppDBConnection.isCreateDBConnections(InppDBConnection.java:356)
 at com.PNA.INPP.InppMain.main(InppMain.java:151)

Answer:

From the error message itself, it is not clear the error message. So it is bit difficult to analyse the problem. Is this a problem in JayBird, as my developer think, or wrong code ?

On checking and testing -

Your code seems to be fine. The problem appears to be that you are not using the correct password for SYSDBA. At least, once we used the correct password the code runs fine. The error is reproduceable everytime with the wrong password.

Like this post? Share on: TwitterFacebookEmail


Related Articles


Author

Firebird Community

Published

Category

Gems from Firebird Support list

Tags