From: Joey G. <joe...@mi...> - 2000-11-29 02:50:59
|
On Tue, 28 Nov 2000 13:23:58 +0800, irwan <ry...@tm...> wrote: ||| Below is i simple code that i've alredy write it but have an error ||| ||| #odbc.py ||| ||| from java.sql import * ||| [snip] ||| >>> from odbc import connection ||| >>>p=connection('Test','sa','password') ||| Traceback (innermost last): ||| File "<console>", line 1, in? ||| FIle "C:\jython\jython-2.0a1\odbc.py" line 5 in? ||| Name Error: Class You also need to import Class from java.lang. In a true Java program you get everything in java.lang imported for free. But In JPython (I really don't like the new name) you have to do it explicitly: from java.lang import * or, if you don't like bringing whole packages in: from java.lang import Class Joey -- -- Sun Certified Java2 Programmer -- Political Rants: www.joeygibson.com -- My Pocket Smalltalk Stuff: st.joeygibson.com -- -- "We thought about killin' him, but we kinda -- hated to go that far...." |