From: Ken E. <ken...@gm...> - 2010-10-09 10:06:49
|
Hi Fred, thanks again for the quick response. I really don't think this has to do with the safety of the class. I tried the jvm argument as suggested in the documentation and it has no effect. I cannot even read your MD5 class, which DOES exist. This create function command cannot resolve ANY classes at all. Was there a bug in 2.0.0 and that is why you asking me to get the snapshot? :/ I'm using maven so I'd rather just work off 2.0.0 from main repository. Thanks, Ken On Sat, Oct 9, 2010 at 5:55 AM, Fred Toussi <fr...@us...>wrote: > Try with the latest snapshot jar from http://hsqldb.org/support/ > > These jars contain the MD5 class. > > If you want to use a function outside the org.hsqldb.lib package, you need > to define its classpath as safe when you execute the HSQLDB server or the > application that embeds it. See the Guide, same chapter. > > On Sat, 09 Oct 2010 05:49 -0400, "Ken Egervari" <ken...@gm...> > wrote: > > Hi Fred, > > I tried your code and get a different error. Something about an unresolved > class name? I tried it with > "org.apache.commons.codec.digest.DigestUtils.md5Hex" instead, but I still > get the same error :/ > > Tips? > > Ken > > > On Sat, Oct 9, 2010 at 5:42 AM, Fred Toussi <fr...@us...>wrote: > > In version 2.0, instead of CREATE ALIAS, you use CREATE FUNCTION. See > the Guide: > > http://hsqldb.org/doc/2.0/guide/sqlroutines-chapt.html#N12D61 > > In these examples two signatures are defined for the MD5 function and can > both be used > > CREATE FUNCTION md5(VARBINARY(128)) > RETURNS VARBINARY(226) > LANGUAGE JAVA > DETERMINISTIC > NO SQL > EXTERNAL NAME 'CLASSPATH:org.hsqldb.lib.MD5.digest' > > CREATE FUNCTION md5(VARCHAR(128),VARCHAR(10)) > RETURNS VARBINARY(226) > LANGUAGE JAVA > DETERMINISTIC > NO SQL > EXTERNAL NAME 'CLASSPATH:org.hsqldb.lib.MD5.digest' > > > CALL md5(X'12345678abcd') > CALL md5('key text','US-ASCII') > > Fred > > > On Sat, 09 Oct 2010 03:40 -0400, "Ken Egervari" <ken...@gm...> > wrote: > > > Hi everyone. I'm trying to use md5(), which I used to create an alias for > in 1.8, but it seems that md5() is now in version 2.0. However, I get an > exception that looks like this: > > Caused by: java.sql.SQLException: user lacks privilege or object not found: > MD5 > at org.hsqldb.jdbc.Util.sqlException(Unknown Source) > at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source) > at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source) > > I am logged in as "sa" with no password, which has always worked before. > The query used to work with an alias in 1.8, and it works in mysql. What do > I need to change to make this work with hsqldb 2.0? Thanks. > > > Ken > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today.http://p.sf.net/sfu/beautyoftheweb > > _______________________________________________ > Hsqldb-user mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/hsqldb-user > > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > Hsqldb-user mailing list > Hsq...@li... > https://lists.sourceforge.net/lists/listinfo/hsqldb-user > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today.http://p.sf.net/sfu/beautyoftheweb > > _______________________________________________ > Hsqldb-user mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/hsqldb-user > > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > Hsqldb-user mailing list > Hsq...@li... > https://lists.sourceforge.net/lists/listinfo/hsqldb-user > > |