db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: securityMechanism for network client - can't make it work
Date Fri, 15 Jun 2007 22:39:02 GMT
>>>>>>>>>>>> David Van Couvering wrote (2007-06-15 15:21:28):
> Thanks, Bernt, that was it.  BTW, "8" is not a very helpful property
> value.  It makes me feel like I'm in a COBOL or Fortran shop.
> 
> We should add support for mnemonics, rather than just the number.
> I'll log a bug.  Also, nowhere in the docs does it say this is what
> you need to do.  I'll log a bug for that too.

There is support for mnemonics... just use 
STRONG_PASSWORD_SUBSTITUTE_SECURITY instead of 8.


> 
> David
> 
> On 6/15/07, Bernt M. Johnsen <Bernt.Johnsen@sun.com> wrote:
> >Well the server is new enough, but what about the client. Look here:
> >
> >10.1.3.1 client driver:
> >
> >$ java -cp 
> >db-derby-10.1.3.1-lib/lib/derbytools.jar:db-derby-13.1-lib/lib/derbyclient.jar org.apache.derby.tools.ij
> >ij version 10.1
> >ij> connect 
> >'jdbc:derby://localhost:1527/travel;create=true;securityMechanism=8';
> >ERROR (no SQLState): security mechanism '8' not supported
> >
> >
> >But with 10.2.2.0 client driver:
> >
> >$ java -cp 
> >db-derby-10.2.2.0-lib/lib/derbytools.jar:db-derby-10.2.2.0-lib/lib/derbyclient.jar
org.apache.derby.tools.ij
> >ij version 10.2
> >ij> connect 
> >'jdbc:derby://localhost:1527/travel;create=true;securityMechanism=8';
> >ERROR 08001: Password can not be null.
> >
> >
> >The server is 10.2.2.0 in both cases (and the last error message is
> >correct, you need to specify user and password when security mechanism is
> >STRONG_PASSWORD_SUBSTITUTE_SECURITY (or 8)).
> >
> >
> >>>>>>>>>>>>> David Van Couvering wrote (2007-06-15
14:17:00):
> >> Hi, Bernt.
> >>
> >> From derby.log:
> >>
> >> Apache Derby Network Server - 10.2.2.0 - (485682) started and ready to
> >> accept connections on port 1527 at 2007-06-15 18:54:04.161 GMT
> >>
> >> client URL (from SquirrelSQL):
> >>
> >> jdbc:derby://localhost:1527/travel;create=true;securityMechanism=8
> >>
> >> On 6/15/07, Bernt M. Johnsen <Bernt.Johnsen@sun.com> wrote:
> >> >Hi, Are you sure you use Derby 10.2.1.6 or newer? The error response
> >> >seems to indicate an earlier version.
> >> >
> >> >Bernt
> >> >
> >> >
> >> >>>>>>>>>>>>> David Van Couvering wrote
(2007-06-15 12:12:38):
> >> >> OK, I'm completely flummoxed.  I am trying to use strong password
> >> >> mechanism instead of password in the clear, in an attempt to try and
> >> >> write up how to do basic security in Derby.
> >> >>
> >> >> I read the docs, and they talk about setting the securityMechanism
> >> >> property on the URL.  But it doesn't actually have an example.  I have
> >> >> tried:
> >> >>
> >> >>
> >> 
> >>"jdbc:derby://localhost:1527;securityMechanism=STRONG_PASSWORD_SUBSTITUTE_SECURITY"
> >> >> java.lang.NumberFormatException: For input string:
> >> >> "STRONG_PASSWORD_SUBSTITUTE_SECURITY"
> >> >>       at
> >> >>
> >> 
> >>java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> >> >>       at java.lang.Integer.parseInt(Integer.java:456)
> >> >>       at java.lang.Short.parseShort(Short.java:120)
> >> >>       at java.lang.Short.parseShort(Short.java:78)
> >> >>       at org.apache.derby.jdbc.ClientBaseDataSource.parseShort(Unknown
> >> >>       Source)
> >> >>       at
> >> >> 
> >org.apache.derby.jdbc.ClientBaseDataSource.getSecurityMechanism(Unknown
> >> >> Source)
> >> >> => NumberFormatException
> >> >>
> >> >> "jdbc:derby://localhost:1527;securityMechanism=0x08"
> >> >>
> >> >> java.lang.NumberFormatException: For input string: "0x08"
> >> >>       at
> >> >>
> >> 
> >>java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> >> >>       at java.lang.Integer.parseInt(Integer.java:456)
> >> >>       at java.lang.Short.parseShort(Short.java:120)
> >> >>       at java.lang.Short.parseShort(Short.java:78)
> >> >>       at org.apache.derby.jdbc.ClientBaseDataSource.parseShort(Unknown
> >> >>       Source)
> >> >>       at
> >> >> 
> >org.apache.derby.jdbc.ClientBaseDataSource.getSecurityMechanism(Unknown
> >> >> Source)
> >> >> "jdbc:derby://localhost:1527;securityMechanism=8"
> >> >>
> >> >> => security mechanism '8' not supported
> >> >>
> >> >> So, can someone tell me what I'm actually supposed to do here?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> David
> >> >
> >> >--
> >> >Bernt Marius Johnsen, Database Technology Group,
> >> >Staff Engineer, Technical Lead Derby/Java DB
> >> >Sun Microsystems, Trondheim, Norway
> >> >
> >> >-----BEGIN PGP SIGNATURE-----
> >> >Version: GnuPG v1.4.2.2 (GNU/Linux)
> >> >
> >> >iD8DBQFGcv3elFBD9TXBAPARAoDTAJ9f/W/gfzNTB0AfSUPAZ0KspR38bwCgg97s
> >> >FJaErlONnU6w4H/V+cQorH0=
> >> >=1uMg
> >> >-----END PGP SIGNATURE-----
> >> >
> >> >
> >
> >--
> >Bernt Marius Johnsen, Database Technology Group,
> >Staff Engineer, Technical Lead Derby/Java DB
> >Sun Microsystems, Trondheim, Norway
> >
> >-----BEGIN PGP SIGNATURE-----
> >Version: GnuPG v1.4.2.2 (GNU/Linux)
> >
> >iD8DBQFGcwknlFBD9TXBAPARAmk2AKCCieN/HuuHmKrYH0QDmDAo5hzG7QCfT3so
> >oJWCqjlQZqiwfeiqW0vkWk0=
> >=DlPX
> >-----END PGP SIGNATURE-----
> >
> >

-- 
Bernt Marius Johnsen, Database Technology Group, 
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway

Mime
View raw message