[jfli-users] jfli for abcl
Status: Beta
Brought to you by:
rhickey
From: Andras S. <as...@ma...> - 2004-07-29 14:20:33
|
http://www.math.bme.hu/~asimon/lisp/jfli-abcl.lisp is a port of jfli to ABCL. I don't know how well it mimics jfli/LW, but the swt demo and the jdbc code in http://sourceforge.net/mailarchive/forum.php?thread_id=5112610&forum_id=41309 appear to work. def-java-class does some package/symbol trickery that LispWorks tolerates but ABCL does not. The symptom is that if you compile and then load a file which has stuff like this: (defpackage :glr (:use :common-lisp :jfli) (:export :open-connection :select :close-connection)) (in-package :glr) (def-java-class "java.sql.DriverManager") (def-java-class "java.sql.Connection") (def-java-class "java.sql.Statement") (def-java-class "java.sql.ResultSet") (def-java-class "java.sql.ResultSetMetaData") (def-java-class "java.util.Properties") ;;(def-java-class "oracle.jdbc.driver.OracleDriver") (def-java-class "org.postgresql.Driver") (use-package "java.lang") (use-package "java.sql") (use-package "org.postgresql") (defvar *connection* nil) (defun open-connection() (declare (optimize (space 3))) (let* ((driver (driver.new)) (properties (properties.new)) (connection (progn (properties.setproperty properties "user" "simon") (properties.setproperty properties "password" "") (driver.connect driver "jdbc:postgresql:mydb" properties)))) (setf *connection* connection))) ABCL will complain that the function driver.new is undefined (it is defined and exported from the package named "org.postgresql" which is USEd by glr; nevertheless, I'm not at all sure that this is an ABCL bug). A workaround for now is to delete the glr package after compiling and before loading the .abcl file. Or (untested) compile and load a file containing only the def-java-class forms first. Andras |