Tcl/Java
interoperability with TclBlend 1.4. A new precompiled binary for
Windows.
Patrick Finnegan and Mo Dejong.
Right
Click for Tclblend: tclBlend140Binary.zip
A new TclBlend 1.4 precompiled binary is available for
Windows. The binary is built from Tcl 8.4.13, Tcl Threads 2.6.3,
and TclJava 1.4. It provides full interoperability between Tcl
and Java through the use of an embedded JVM and supports existing Tcl
extensions or packages such as Expect, Tcom, Tk, Tcllib, TclX and
Snack. To install download the zip file and extract to your
installation directory. No compilation required. Run a
TclBlend script just like a Tcl/TK script.
C:\TclBlend\bin\jtclsh.exe oracleJDBCType4.tcl -
connect to oracle using a jdbc driver and tclBlend.
TclBlend should be backwards compatible with all Tcl Scripts written to
the Tcl 8.4.13 specification.
The TclJava extension uses the Java Native Interface to dynamically
load a JVM within a C program. The extension was compiled against JAVA
1.4.2.12. TclBlend is shipped with an embedded JVM which is
loaded into the Tcl runtime on execution of the "package require java"
statement. Tcl scripts access the java class libraries using
JACL(Java Command language) syntax. Connectivity to remote java
applications or services is possible using the appropriate third party
java class drivers. See the examples for more details.
Resources
TclBlend Website: http://tcljava.sourceforge.net/docs/website/index.html
TclBlend Manual: http://tcljava.sourceforge.net/docs/TclJava/contents.html
Bedtime Reading: http://tcljava.sourceforge.net/docs/website/links.html
Examples
1: http://aspn.activestate.com/ASPN/Cookbook/Tcl?kwd=Databases
Examples 2: http://aspn.activestate.com/ASPN/Cookbook/Tcl?kwd=TclBlend
JNI:
http://java.sun.com/j2se/1.4.2/docs/guide/jni/
Development Tools
Nagelgar Syntax Checker: http://nagelfar.berlios.de/
Debugger:
http://www2.compassis.com/ramdebugger
CrowTde IDE:
http://crowtde.sourceforge.net/
Tcl Eclipse Plugin:
http://www.eclipsedltk.org/
Active State:
http://www.activestate.com/products/activetcl/
Notes
There are no non core packages included with the TclBlend distro
however packages like Expect, Tcllib etc can be copied over from an
existing Tcl installation. Just put them in the lib directory.
e.g copy to C:\tclBlend140Binary\TclBlend\lib
TclBlend can be installed across machines by simply copying the
TclBlend/* directory structure to the target machine.
Install Instructions.
### Strictly BETA. Use at your own risk
1. Unzip the binary to your installation directory.
Unzip to C:\tclBlend140Binary\TclBlend
2. Test.
cd C:\tclBlend140Binary\TclBlend\bin\jtclsh.exe
% package require java
1.4.0
% java::import java.net.InetAddress
% puts "My IP Address is: [ [ java::call InetAddress getLocalHost ]
getHostAddress ] "
My IP Address is: 123.4.5.6.7
## Run a script with embedded JVM.
C:\tclBlend140Binary\TclBlend\bin\jtclsh.exe oracleJDBCType4.tcl
[2007-01-30-19.35.15] executing C:\oracleJDBCType4.tcl
[2007-01-30-19.35.15] connection URL is:
jdbc:oracle:thin:xxx/xxxx@xxx:124:yyy
[2007-01-30-19.35.15] transaction isolation level is 2
[2007-01-30-19.35.15] #########################################
[2007-01-30-19.35.15] ### Database connection details
[2007-01-30-19.35.15] #########################################
[2007-01-30-19.35.15] Oracle
[2007-01-30-19.35.15] Oracle9i Enterprise Edition Release 9.2.0.7.0
[2007-01-30-19.35.15] driver version Oracle JDBC driver 10.2
[2007-01-30-19.35.15] jdbc version 10.2
[2007-01-30-19.35.15] transaction isolation level is 2