You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(107) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(76) |
Feb
(125) |
Mar
(72) |
Apr
(13) |
May
(18) |
Jun
(12) |
Jul
(129) |
Aug
(47) |
Sep
(1) |
Oct
(36) |
Nov
(128) |
Dec
(124) |
2002 |
Jan
(59) |
Feb
|
Mar
(14) |
Apr
(14) |
May
(72) |
Jun
(9) |
Jul
(3) |
Aug
(5) |
Sep
(18) |
Oct
(65) |
Nov
(28) |
Dec
(12) |
2003 |
Jan
(10) |
Feb
(2) |
Mar
(4) |
Apr
(33) |
May
(21) |
Jun
(9) |
Jul
(29) |
Aug
(34) |
Sep
(4) |
Oct
(8) |
Nov
(15) |
Dec
(4) |
2004 |
Jan
(26) |
Feb
(12) |
Mar
(11) |
Apr
(9) |
May
(7) |
Jun
|
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(7) |
Nov
(1) |
Dec
(10) |
2005 |
Jan
(2) |
Feb
(72) |
Mar
(16) |
Apr
(39) |
May
(48) |
Jun
(97) |
Jul
(57) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(100) |
Dec
(24) |
2006 |
Jan
(15) |
Feb
(34) |
Mar
(33) |
Apr
(31) |
May
(79) |
Jun
(64) |
Jul
(41) |
Aug
(64) |
Sep
(31) |
Oct
(46) |
Nov
(55) |
Dec
(37) |
2007 |
Jan
(32) |
Feb
(61) |
Mar
(11) |
Apr
(58) |
May
(46) |
Jun
(30) |
Jul
(94) |
Aug
(93) |
Sep
(86) |
Oct
(69) |
Nov
(125) |
Dec
(177) |
2008 |
Jan
(169) |
Feb
(97) |
Mar
(74) |
Apr
(113) |
May
(120) |
Jun
(334) |
Jul
(215) |
Aug
(237) |
Sep
(72) |
Oct
(189) |
Nov
(126) |
Dec
(160) |
2009 |
Jan
(180) |
Feb
(45) |
Mar
(98) |
Apr
(140) |
May
(151) |
Jun
(71) |
Jul
(107) |
Aug
(119) |
Sep
(73) |
Oct
(121) |
Nov
(14) |
Dec
(6) |
2010 |
Jan
(13) |
Feb
(9) |
Mar
(10) |
Apr
(64) |
May
(3) |
Jun
(16) |
Jul
(7) |
Aug
(23) |
Sep
(17) |
Oct
(37) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(10) |
Feb
(11) |
Mar
(77) |
Apr
(11) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Finn B. <bc...@us...> - 2001-12-31 13:43:55
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv19724 Modified Files: links.h Log Message: Updated links to 2.1 downloads. Index: links.h =================================================================== RCS file: /cvsroot/jython/htdocs/links.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** links.h 2001/12/21 22:25:47 1.12 --- links.h 2001/12/31 13:43:52 1.13 *************** *** 3,8 **** <li><a href="./index.html">Overview</a> <li><a href="license.html">License</a> ! <li><a href="download.html">Jython 2.0</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=66632">Jython 2.1b2</a> <li><a href="install.html">Installing</a> <li><a href="platform.html">JVM Compatibility</a> --- 3,8 ---- <li><a href="./index.html">Overview</a> <li><a href="license.html">License</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=21045">Jython 2.0</a> ! <li><a href="download.html">Jython 2.1</a> <li><a href="install.html">Installing</a> <li><a href="platform.html">JVM Compatibility</a> |
From: Finn B. <bc...@us...> - 2001-12-31 13:43:55
|
Update of /cvsroot/jython/htdocs/applets In directory usw-pr-cvs1:/tmp/cvs-serv19724/applets Modified Files: links.h Log Message: Updated links to 2.1 downloads. Index: links.h =================================================================== RCS file: /cvsroot/jython/htdocs/applets/links.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** links.h 2001/12/21 22:25:48 1.5 --- links.h 2001/12/31 13:43:52 1.6 *************** *** 3,8 **** <li><a href="../index.html">Overview</a> <li><a href="../license.html">License</a> ! <li><a href="../download.html">Jython 2.0</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=66632">Jython 2.1b2</a> <li><a href="../install.html">Installing</a> <li><a href="../platform.html">JVM Compatibility</a> --- 3,8 ---- <li><a href="../index.html">Overview</a> <li><a href="../license.html">License</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=21045">Jython 2.0</a> ! <li><a href="../download.html">Jython 2.1</a> <li><a href="../install.html">Installing</a> <li><a href="../platform.html">JVM Compatibility</a> |
From: Finn B. <bc...@us...> - 2001-12-31 13:42:36
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv19481 Modified Files: license.ht Log Message: Generated from the "LICENSE.txt" file. Index: license.ht =================================================================== RCS file: /cvsroot/jython/htdocs/license.ht,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** license.ht 2001/12/03 21:13:56 1.5 --- license.ht 2001/12/31 13:42:33 1.6 *************** *** 7,11 **** took over as primary developer and released JPython version 1.1. In October 2000 Barry helped move the software to SourceForge ! where it was renamed to Jython. Jython 2.0 is developed by a group of volunteers. --- 7,11 ---- took over as primary developer and released JPython version 1.1. In October 2000 Barry helped move the software to SourceForge ! where it was renamed to Jython. Jython is developed by a group of volunteers. |
From: Finn B. <bc...@us...> - 2001-12-31 13:42:08
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv19366 Modified Files: index.ht Log Message: Re-added the link to NEWS. Index: index.ht =================================================================== RCS file: /cvsroot/jython/htdocs/index.ht,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** index.ht 2001/12/31 12:03:58 1.26 --- index.ht 2001/12/31 13:42:05 1.27 *************** *** 22,26 **** <p><dt><b>Jython 2.1 released!</b> <dd>Download the latest stable relase of Jython ! <a href="download.html">here</a> (31-dec-2001). <p><dt><b>New website layout.</b> --- 22,28 ---- <p><dt><b>Jython 2.1 released!</b> <dd>Download the latest stable relase of Jython ! <a href="download.html">here</a> and ! <a href="NEWS.html">read a summary</a> of recent changes.<br> ! (31-dec-2001). <p><dt><b>New website layout.</b> |
From: Finn B. <bc...@us...> - 2001-12-31 13:41:25
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv19233 Modified Files: download.ht Log Message: Updated to 2.1final. Index: download.ht =================================================================== RCS file: /cvsroot/jython/htdocs/download.ht,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** download.ht 2001/01/17 15:49:06 1.9 --- download.ht 2001/12/31 13:41:23 1.10 *************** *** 28,37 **** <p>Please use the following links to view and accept the licenses ! for Jython 2.0. <p><ul> <li><a href="license.html">Read the license</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867"> ! Download Jython 2.0</a> <li><a href="install.html">View Installation instructions</a> </ul> --- 28,37 ---- <p>Please use the following links to view and accept the licenses ! for Jython 2.1. <p><ul> <li><a href="license.html">Read the license</a> ! <li><a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=67726"> ! Download Jython 2.1</a> <li><a href="install.html">View Installation instructions</a> </ul> *************** *** 79,81 **** </UL> ! <p> \ No newline at end of file --- 79,81 ---- </UL> ! <p> |
From: Finn B. <bc...@us...> - 2001-12-31 13:41:08
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv19146 Modified Files: NEWS.ht Log Message: Generated from the "NEWS" file. Index: NEWS.ht =================================================================== RCS file: /cvsroot/jython/htdocs/NEWS.ht,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NEWS.ht 2001/12/21 22:24:00 1.13 --- NEWS.ht 2001/12/31 13:41:05 1.14 *************** *** 2,5 **** --- 2,12 ---- Jython NEWS + 31-dec-2001 Jython 2.1 final + + Bug fixes. + - [ #493359 ] Installer should include <EXIT> button + - [ #495602 ] os.path.dirname() can result in an NPE + - [ #495604 ] imp.find_module fails when None is 2 arg + 21-dec-2001 Jython 2.1 beta 2 |
From: Finn B. <bc...@us...> - 2001-12-31 13:40:12
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv18885 Modified Files: LICENSE.txt Log Message: Removed the version number. I should have done this before uploading 2.1 to SF. Too late now. Index: LICENSE.txt =================================================================== RCS file: /cvsroot/jython/jython/LICENSE.txt,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** LICENSE.txt 2001/11/22 05:43:47 2.4 --- LICENSE.txt 2001/12/31 13:40:09 2.5 *************** *** 6,10 **** took over as primary developer and released JPython version 1.1. In October 2000 Barry helped move the software to SourceForge ! where it was renamed to Jython. Jython 2.0 is developed by a group of volunteers. --- 6,10 ---- took over as primary developer and released JPython version 1.1. In October 2000 Barry helped move the software to SourceForge ! where it was renamed to Jython. Jython is developed by a group of volunteers. |
From: Finn B. <bc...@us...> - 2001-12-31 12:04:02
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv7485 Modified Files: index.ht Log Message: Prepare for 2.1final. Index: index.ht =================================================================== RCS file: /cvsroot/jython/htdocs/index.ht,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** index.ht 2001/12/21 22:25:11 1.25 --- index.ht 2001/12/31 12:03:58 1.26 *************** *** 20,32 **** <dl> ! <p><dt><b>Jython 2.1 beta 2 released!</b> ! <dd>Download the latest release of Jython ! <a href="http://sourceforge.net/project/showfiles.php?group_id=12867&release_id=66632">here</a>, or ! <a href="NEWS.html">read a summary</a> ! of recent changes. (21-dec-2001). ! ! <p><dt><b>Jython 2.0 released!</b> <dd>Download the latest stable relase of Jython ! <a href="download.html">here</a> (17-jan-2001). <p><dt><b>New website layout.</b> --- 20,26 ---- <dl> ! <p><dt><b>Jython 2.1 released!</b> <dd>Download the latest stable relase of Jython ! <a href="download.html">here</a> (31-dec-2001). <p><dt><b>New website layout.</b> *************** *** 82,86 **** </dl> ! <font size=-1> last updated 21-dec-2001 </font> --- 76,80 ---- </dl> ! <font size=-1> last updated 31-dec-2001 </font> |
From: Finn B. <bc...@us...> - 2001-12-31 11:43:30
|
Update of /cvsroot/jython/htdocs In directory usw-pr-cvs1:/tmp/cvs-serv4835 Modified Files: install.ht Log Message: Prepare for 2.1final. Index: install.ht =================================================================== RCS file: /cvsroot/jython/htdocs/install.ht,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** install.ht 2001/03/22 21:38:54 1.11 --- install.ht 2001/12/31 11:43:28 1.12 *************** *** 6,13 **** <A HREF="http://liftoff.sourceforge.net">LiftOff</A>. To install Jython, open the command line to the directory in which ! you have placed the jython-20.class file and then type: <BLOCKQUOTE> ! <P><java interpreter> jython-20</P> </BLOCKQUOTE> --- 6,13 ---- <A HREF="http://liftoff.sourceforge.net">LiftOff</A>. To install Jython, open the command line to the directory in which ! you have placed the jython-21.class file and then type: <BLOCKQUOTE> ! <P><java interpreter> jython-21</P> </BLOCKQUOTE> *************** *** 17,25 **** <BLOCKQUOTE> ! <P><TT>java jython-20</TT></P> ! <P><TT>jre jython-20</TT></P> ! <P><TT>jview jython-20</TT> </BLOCKQUOTE> --- 17,25 ---- <BLOCKQUOTE> ! <P><TT>java jython-21</TT></P> ! <P><TT>jre jython-21</TT></P> ! <P><TT>jview jython-21</TT> </BLOCKQUOTE> *************** *** 27,37 **** <BLOCKQUOTE> ! <P><TT>env CLASSPATH=. java jython-20</TT> ! <P><TT>java -cp . jython-20</TT> ! <P><TT>java -classpath . jython-20</TT> ! <P><TT>jview /cp:. jython-20</TT> </BLOCKQUOTE> --- 27,37 ---- <BLOCKQUOTE> ! <P><TT>env CLASSPATH=. java jython-21</TT> ! <P><TT>java -cp . jython-21</TT> ! <P><TT>java -classpath . jython-21</TT> ! <P><TT>jview /cp:. jython-21</TT> </BLOCKQUOTE> *************** *** 40,54 **** path the java command. When installing the JDK 1.2 from javasoft, the default is it install both the JDK and a plugin JRE. The plugin JRE is added ! to your PATH, so running the <tt>java jython-20a</tt> command will make jython use the JRE. Specify the full path if you want to use JDK instead, ie: ! <tt>c:\Programs\JDK1.2\bin\java -cp . jython-20</tt>. <P>If you do not have a GUI, then add <tt>-o dir_to_install_to</tt> to the command above. Jython will install to the specified directory without bringing up the graphical installer. E.g. to install all modules to a ! Jython-2.0 subdirectory in the current directory do: <BLOCKQUOTE> ! <P><TT><java interpreter> jython-20 -o Jython-2.0 demo lib source</TT> </BLOCKQUOTE> --- 40,54 ---- path the java command. When installing the JDK 1.2 from javasoft, the default is it install both the JDK and a plugin JRE. The plugin JRE is added ! to your PATH, so running the <tt>java jython-21</tt> command will make jython use the JRE. Specify the full path if you want to use JDK instead, ie: ! <tt>c:\Programs\JDK1.2\bin\java -cp . jython-21</tt>. <P>If you do not have a GUI, then add <tt>-o dir_to_install_to</tt> to the command above. Jython will install to the specified directory without bringing up the graphical installer. E.g. to install all modules to a ! Jython-2.1 subdirectory in the current directory do: <BLOCKQUOTE> ! <P><TT><java interpreter> jython-21 -o Jython-2.1 demo lib source</TT> </BLOCKQUOTE> *************** *** 83,87 **** <A HREF="mailto:jyt...@li...">jython-dev</A>. ! <P>As a workaround you can extract the jython-20.class manually. The class file is basicly a .zip file and most unzip programs can manage to extract the contents of the class into a directory. --- 83,87 ---- <A HREF="mailto:jyt...@li...">jython-dev</A>. ! <P>As a workaround you can extract the jython-21.class manually. The class file is basicly a .zip file and most unzip programs can manage to extract the contents of the class into a directory. *************** *** 99,101 **** <A HREF="platform.html">Platform Specific Information</A> page. ! <p> \ No newline at end of file --- 99,101 ---- <A HREF="platform.html">Platform Specific Information</A> page. ! <p> |
From: Finn B. <bc...@us...> - 2001-12-31 11:34:48
|
Update of /cvsroot/jython/jython/installer In directory usw-pr-cvs1:/tmp/cvs-serv3868 Modified Files: liftoff.filelist Log Message: Some new files in 2.1final. Index: liftoff.filelist =================================================================== RCS file: /cvsroot/jython/jython/installer/liftoff.filelist,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** liftoff.filelist 2001/12/20 18:27:47 1.26 --- liftoff.filelist 2001/12/31 11:34:45 1.27 *************** *** 155,158 **** --- 155,159 ---- t Doc/javadoc/org/python/core/PyModule.html ..\Doc\javadoc\org\python\core\PyModule.html t Doc/javadoc/org/python/core/PyNone.html ..\Doc\javadoc\org\python\core\PyNone.html + t Doc/javadoc/org/python/core/PyNotImplemented.html ..\Doc\javadoc\org\python\core\PyNotImplemented.html t Doc/javadoc/org/python/core/PyObject.html ..\Doc\javadoc\org\python\core\PyObject.html t Doc/javadoc/org/python/core/PyProxy.html ..\Doc\javadoc\org\python\core\PyProxy.html *************** *** 194,197 **** --- 195,199 ---- t Doc/javadoc/org/python/util/ReadlineConsole.html ..\Doc\javadoc\org\python\util\ReadlineConsole.html t Doc/javadoc/com/ziclix/python/sql/DataHandler.html ..\Doc\javadoc\com\ziclix\python\sql\DataHandler.html + t Doc/javadoc/com/ziclix/python/sql/DBApiType.html ..\Doc\javadoc\com\ziclix\python\sql\DBApiType.html t Doc/javadoc/com/ziclix/python/sql/Fetch.html ..\Doc\javadoc\com\ziclix\python\sql\Fetch.html t Doc/javadoc/com/ziclix/python/sql/FilterDataHandler.html ..\Doc\javadoc\com\ziclix\python\sql\FilterDataHandler.html *************** *** 200,203 **** --- 202,206 ---- t Doc/javadoc/com/ziclix/python/sql/package-summary.html ..\Doc\javadoc\com\ziclix\python\sql\package-summary.html t Doc/javadoc/com/ziclix/python/sql/package-tree.html ..\Doc\javadoc\com\ziclix\python\sql\package-tree.html + t Doc/javadoc/com/ziclix/python/sql/Procedure.html ..\Doc\javadoc\com\ziclix\python\sql\Procedure.html t Doc/javadoc/com/ziclix/python/sql/PyConnection.html ..\Doc\javadoc\com\ziclix\python\sql\PyConnection.html t Doc/javadoc/com/ziclix/python/sql/PyCursor.html ..\Doc\javadoc\com\ziclix\python\sql\PyCursor.html *************** *** 452,455 **** --- 455,459 ---- t Lib/jxxload_help/PathVFS.java ..\Lib\jxxload_help\PathVFS.java t Lib/jxxload_help/PathVFSJavaLoader.java ..\Lib\jxxload_help\PathVFSJavaLoader.java + t Lib/jxxload_help/Makefile ..\Lib\jxxload_help\Makefile t com/ziclix/python/sql/DataHandler.java ..\com\ziclix\python\sql\DataHandler.java t com/ziclix/python/sql/DBApiType.java ..\com\ziclix\python\sql\DBApiType.java *************** *** 479,482 **** --- 483,487 ---- t com/ziclix/python/sql/handler/OracleDataHandler.java ..\com\ziclix\python\sql\handler\OracleDataHandler.java t com/ziclix/python/sql/handler/PostgresqlDataHandler.java ..\com\ziclix\python\sql\handler\PostgresqlDataHandler.java + t com/ziclix/python/sql/handler/SQLServerDataHandler.java ..\com\ziclix\python\sql\handler\SQLServerDataHandler.java t com/ziclix/python/sql/handler/UpdateCountDataHandler.java ..\com\ziclix\python\sql\handler\UpdateCountDataHandler.java t com/ziclix/python/sql/connect/Connect.java ..\com\ziclix\python\sql\connect\Connect.java |
From: Finn B. <bc...@us...> - 2001-12-31 11:22:03
|
Update of /cvsroot/jython/jython/installer In directory usw-pr-cvs1:/tmp/cvs-serv2577 Modified Files: liftoff.props Log Message: Updated to 2.1final. Index: liftoff.props =================================================================== RCS file: /cvsroot/jython/jython/installer/liftoff.props,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** liftoff.props 2001/12/21 20:44:13 1.13 --- liftoff.props 2001/12/31 11:22:00 1.14 *************** *** 2,9 **** product.author=The Jython Team product.string=Jython ! product.version=2.1b2 java.minVersion=1.1 product.root= ! destination.package_prefix=jython-2.1b2 license.licenseText=LICENSE.txt product.readmeText=README.txt --- 2,9 ---- product.author=The Jython Team product.string=Jython ! product.version=2.1 java.minVersion=1.1 product.root= ! destination.package_prefix=jython-2.1 license.licenseText=LICENSE.txt product.readmeText=README.txt |
From: Finn B. <bc...@us...> - 2001-12-31 11:18:22
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv2113 Modified Files: PySystemState.java Log Message: Updated to 2.1final. Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.73 retrieving revision 2.74 diff -C2 -d -r2.73 -r2.74 *** PySystemState.java 2001/12/20 18:29:51 2.73 --- PySystemState.java 2001/12/31 11:18:18 2.74 *************** *** 18,28 **** * The current version of JPython. */ ! public static String version = "2.1b2"; private static int PY_MAJOR_VERSION = 2; private static int PY_MINOR_VERSION = 1; private static int PY_MICRO_VERSION = 0; ! private static int PY_RELEASE_LEVEL = 0xB; ! private static int PY_RELEASE_SERIAL = 2; public static int hexversion = ((PY_MAJOR_VERSION << 24) | --- 18,28 ---- * The current version of JPython. */ ! public static String version = "2.1"; private static int PY_MAJOR_VERSION = 2; private static int PY_MINOR_VERSION = 1; private static int PY_MICRO_VERSION = 0; ! private static int PY_RELEASE_LEVEL = 0xF; ! private static int PY_RELEASE_SERIAL = 0; public static int hexversion = ((PY_MAJOR_VERSION << 24) | *************** *** 422,426 **** else if (PY_RELEASE_LEVEL == 0x0C) s = "candidate"; ! else if (PY_RELEASE_LEVEL == 0x0C) s = "final"; version_info = new PyTuple(new PyObject[] { --- 422,426 ---- else if (PY_RELEASE_LEVEL == 0x0C) s = "candidate"; ! else if (PY_RELEASE_LEVEL == 0x0F) s = "final"; version_info = new PyTuple(new PyObject[] { |
From: Finn B. <bc...@us...> - 2001-12-31 10:15:13
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv25606 Modified Files: NEWS Log Message: 2.1 final bug fixes. Index: NEWS =================================================================== RCS file: /cvsroot/jython/jython/NEWS,v retrieving revision 2.43 retrieving revision 2.44 diff -C2 -d -r2.43 -r2.44 *** NEWS 2001/12/21 21:03:15 2.43 --- NEWS 2001/12/31 10:15:10 2.44 *************** *** 1,4 **** --- 1,11 ---- Jython NEWS + 31-dec-2001 Jython 2.1 final + + Bug fixes. + - [ #493359 ] Installer should include <EXIT> button + - [ #495602 ] os.path.dirname() can result in an NPE + - [ #495604 ] imp.find_module fails when None is 2 arg + 21-dec-2001 Jython 2.1 beta 2 |
From: Finn B. <bc...@us...> - 2001-12-30 19:18:14
|
Update of /cvsroot/jython/jython/Doc In directory usw-pr-cvs1:/tmp/cvs-serv8967 Modified Files: registry.ht Log Message: Added doc for python.console.readlinelib. Index: registry.ht =================================================================== RCS file: /cvsroot/jython/jython/Doc/registry.ht,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -d -r2.3 -r2.4 *** registry.ht 2001/03/27 17:37:31 2.3 --- registry.ht 2001/12/30 19:18:11 2.4 *************** *** 72,76 **** that supports <a href="http://www.bablokb.de/java/readline.html"> GNU readline</a> ! can be installed with this property. </dl> --- 72,84 ---- that supports <a href="http://www.bablokb.de/java/readline.html"> GNU readline</a> ! can be installed with this property. Jython already include such a ! console class and it can be enabled by setting this property to ! <code>org.python.util.ReadlineConsole</code> ! ! <dt><b>python.console.readlinelib</b> ! <dd>Allow a choice of backing implementation for GNU readline support. ! Can be either <code>GnuReadline</code> or <code>Editline</code>. ! This property is only used when <b>python.console</b> is set to ! <code>org.python.util.ReadlineConsole</code>. </dl> |
From: brian z. <bz...@us...> - 2001-12-29 18:00:18
|
Update of /cvsroot/jython/jython/Doc In directory usw-pr-cvs1:/tmp/cvs-serv25219/Doc Modified Files: zxjdbc.ht Log Message: changed rowid to lastrowid per the spec Index: zxjdbc.ht =================================================================== RCS file: /cvsroot/jython/jython/Doc/zxjdbc.ht,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -d -r2.3 -r2.4 *** zxjdbc.ht 2001/12/21 04:10:00 2.3 --- zxjdbc.ht 2001/12/29 18:00:15 2.4 *************** *** 137,140 **** --- 137,196 ---- </pre> + <p> + To call a stored procedure or function provide the name and any params to <code>callproc</code>. + The database engine must support stored procedures. The examples below have been tested with + Oracle, SQLServer and Informix. Refer to the Python DP API spec for how OUT and INOUT parameters + work. + </p> + <p> + NOTE: The name of the stored procedure can either be a string or tuple. This is NOT portable to + other DB API implementations. + <pre> + <b><i>SQL Server</b></i> + >>> c = db.cursor() # open the database as in the examples above + >>> c.execute("use northwind") + >>> c.callproc(("northwind", "dbo", "SalesByCategory"), ["Seafood", "1998"], maxrows=2) + >>> for a in c.description: + ... print a + ... + ('ProductName', -9, 40, None, None, None, 0) + ('TotalPurchase', 3, 17, None, 38, 2, 1) + >>> for a in c.fetchall(): + ... print a + ... + ('Boston Crab Meat', 5318.0) + ('Carnarvon Tigers', 8497.0) + >>> c.nextset() + 1 + >>> print c.fetchall() + [(0,)] + >>> print c.description + [('@RETURN_VALUE', 4, -1, 4, 10, 0, 0)] + >>> + </pre> + + <pre> + <b><i>Oracle</b></i> + >>> c = db.cursor() # open the database as in the examples above + >>> c.execute("create or replace function funcout (y out varchar2) return varchar2 is begin y := 'tested'; return 'returned'; end;") + >>> params = [None] + >>> c.callproc("funcout", params) + >>> print params + ['tested'] + >>> print c.description + [(None, 12.0, -1, None, None, None, 1)] + >>> print c.fetchall() + [('returned',)] + >>> + </pre> + + <p>When finished, close the connections.</p> + + <pre> + >>> c.close() + >>> db.close() + >>> + </pre> + <h3>Standard extensions to the Python DB API</h3> *************** *** 159,163 **** Statement.getUpdateCount</a></dd> ! <dt><p><code class="methodname">cursor.rowid</code></p></dt> <dd>The value obtained from calling <a --- 215,219 ---- Statement.getUpdateCount</a></dd> ! <dt><p><code class="methodname">cursor.lastrowid</code></p></dt> <dd>The value obtained from calling <a *************** *** 273,280 **** stored procedure or function. Given the JDBC type, return the appropriate PyObject subclass from the Java object at column col in the CallableStatement.</dd> ! <dt><p><code class="methodname">public void registerOut(CallableStatement statement, ! int index, int colType, int dataType) throws SQLException;</code></p></dt> ! <dd>This method is called when a stored procedure or function is executed and OUT parameters ! need to be registered with the statement.</dd> </dl> --- 329,339 ---- stored procedure or function. Given the JDBC type, return the appropriate PyObject subclass from the Java object at column col in the CallableStatement.</dd> ! <dt><p><code class="methodname">public void registerOut(CallableStatement statement, int ! index, int colType, int dataType, String dataTypeName) throws SQLException;</code></p></dt> ! <dd>This method is called to register an OUT or INOUT parameter on the stored procedure. ! The dataType comes from java.sql.Types while the dataTypeName is a vendor specific string.</dd> ! <dt><p><code class="methodname">public String getProcedureName(PyObject catalog, PyObject ! schema, PyObject name);</code></p></dt> ! <dd>This method is called to build a stored procedure's name.</dd> </dl> *************** *** 354,361 **** <pre> [default] ! name=mysql_ziclix [jdbc] ! name=mysql_ziclix url=jdbc:mysql://localhost/ziclix user= --- 413,420 ---- <pre> [default] ! name=mysql [jdbc] ! name=mysql url=jdbc:mysql://localhost/ziclix user= *************** *** 365,369 **** [jdbc] ! name=ora_ziclix url=jdbc:oracle:thin:@localhost:1521:ziclix user=ziclix --- 424,428 ---- [jdbc] ! name=ora url=jdbc:oracle:thin:@localhost:1521:ziclix user=ziclix |
From: brian z. <bz...@us...> - 2001-12-29 18:00:17
|
Update of /cvsroot/jython/jython/com/ziclix/python/sql In directory usw-pr-cvs1:/tmp/cvs-serv25219/com/ziclix/python/sql Modified Files: PyCursor.java Log Message: changed rowid to lastrowid per the spec Index: PyCursor.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/PyCursor.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyCursor.java 2001/12/29 07:16:20 1.11 --- PyCursor.java 2001/12/29 18:00:14 1.12 *************** *** 37,41 **** /** Field warnings */ ! protected PyObject rowid; /** Field updatecount */ --- 37,41 ---- /** Field warnings */ ! protected PyObject lastrowid; /** Field updatecount */ *************** *** 124,128 **** m[3] = new PyString("datahandler"); m[4] = new PyString("warnings"); ! m[5] = new PyString("rowid"); m[6] = new PyString("updatecount"); __members__ = new PyList(m); --- 124,128 ---- m[3] = new PyString("datahandler"); m[4] = new PyString("warnings"); ! m[5] = new PyString("lastrowid"); m[6] = new PyString("updatecount"); __members__ = new PyList(m); *************** *** 175,180 **** } else if ("warnings".equals(name)) { return warnings; ! } else if ("rowid".equals(name)) { ! return rowid; } else if ("updatecount".equals(name)) { return updatecount; --- 175,180 ---- } else if ("warnings".equals(name)) { return warnings; ! } else if ("lastrowid".equals(name)) { ! return lastrowid; } else if ("updatecount".equals(name)) { return updatecount; *************** *** 473,477 **** /** * Execute the current sql statement. Some generic functionality such ! * as updating the rowid and updatecount occur as well. * * @param ExecuteSQL execute --- 473,477 ---- /** * Execute the current sql statement. Some generic functionality such ! * as updating the lastrowid and updatecount occur as well. * * @param ExecuteSQL execute *************** *** 487,491 **** execute.executeSQL(); ! this.rowid = this.datahandler.getRowId(this.sqlStatement); this.updatecount = Py.newInteger(this.sqlStatement.getUpdateCount()); --- 487,491 ---- execute.executeSQL(); ! this.lastrowid = this.datahandler.getRowId(this.sqlStatement); this.updatecount = Py.newInteger(this.sqlStatement.getUpdateCount()); *************** *** 657,661 **** this.warnings = Py.None; ! this.rowid = Py.None; this.updatecount = Py.newInteger(-1); --- 657,661 ---- this.warnings = Py.None; ! this.lastrowid = Py.None; this.updatecount = Py.newInteger(-1); |
From: brian z. <bz...@us...> - 2001-12-29 18:00:17
|
Update of /cvsroot/jython/jython/Lib/test/zxjdbc In directory usw-pr-cvs1:/tmp/cvs-serv25219/Lib/test/zxjdbc Modified Files: zxtest.py Log Message: changed rowid to lastrowid per the spec Index: zxtest.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/zxtest.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** zxtest.py 2001/12/29 07:16:55 1.4 --- zxtest.py 2001/12/29 18:00:14 1.5 *************** *** 364,367 **** --- 364,369 ---- c.execute("insert into zxtesting values (?, ?, ?)", [(500, 'bz', 'or')]) assert c.updatecount == 1, "expected [1], got [%d]" % (c.updatecount) + c.execute("select * from zxtesting") + assert c.updatecount == -1, "expected updatecount to be -1 after query" # there's a *feature* in the mysql engine where it returns 0 for delete if there is no # where clause, regardless of the actual value. using a where clause forces it to calculate *************** *** 561,565 **** c = self.cursor() ! assert "expected initial rowid to be None", c.rowid == None try: --- 563,567 ---- c = self.cursor() ! assert c.lastrowid == None, "expected initial lastrowid to be None" try: *************** *** 569,579 **** c.execute("insert into %s (b) values (?)" % (tabname), [(0,)]) ! assert c.rowid is not None, "rowid is None" try: ! for idx in range(c.rowid + 1, c.rowid + 25): c.execute("insert into %s (b) values (?)" % (tabname), [(idx,)]) ! assert c.rowid is not None, "rowid is None" ! assert c.rowid == idx, "expected rowid [%d], got [%d]" % (idx, c.rowid) except: self.db.rollback() --- 571,581 ---- c.execute("insert into %s (b) values (?)" % (tabname), [(0,)]) ! assert c.lastrowid is not None, "lastrowid is None" try: ! for idx in range(c.lastrowid + 1, c.lastrowid + 25): c.execute("insert into %s (b) values (?)" % (tabname), [(idx,)]) ! assert c.lastrowid is not None, "lastrowid is None" ! self.assertEquals(idx, c.lastrowid) except: self.db.rollback() |
From: brian z. <bz...@us...> - 2001-12-29 18:00:17
|
Update of /cvsroot/jython/jython/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25219/Lib Modified Files: dbexts.py Log Message: changed rowid to lastrowid per the spec Index: dbexts.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/dbexts.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dbexts.py 2001/12/29 07:17:42 1.3 --- dbexts.py 2001/12/29 18:00:15 1.4 *************** *** 27,48 **** [default] ! name=development [jdbc] ! name=development ! url=jdbc:db:devurl ! username=root ! password=12345 [jdbc] ! name=production ! url=jdbc:db:produrl ! username=root ! password=12345 ! ! [odbc] ! name=development ! username=root ! password=12345 """ --- 27,47 ---- [default] ! name=mysql [jdbc] ! name=mysql ! url=jdbc:mysql://localhost/ziclix ! user= ! pwd= ! driver=org.gjt.mm.mysql.Driver ! datahandler=com.ziclix.python.sql.handler.MySQLDataHandler [jdbc] ! name=pg ! url=jdbc:postgresql://localhost:5432/ziclix ! user=bzimmer ! pwd= ! driver=org.postgresql.Driver ! datahandler=com.ziclix.python.sql.handler.PostgresqlDataHandler """ *************** *** 180,189 **** self.formatter = formatter self.out = out ! self.rowid = None self.updatecount = None if not jndiname: ! if cfg == None: cfg = os.path.join(os.path.split(__file__)[0], "dbexts.ini") ! if isinstance(cfg, IniParser): self.dbs = cfg else: --- 179,192 ---- self.formatter = formatter self.out = out ! self.lastrowid = None self.updatecount = None if not jndiname: ! if cfg == None: ! fn = os.path.join(os.path.split(__file__)[0], "dbexts.ini") ! if not os.path.exists(fn): ! fn = os.path.join(os.environ['HOME'], ".dbexts") ! self.dbs = IniParser(fn) ! elif isinstance(cfg, IniParser): self.dbs = cfg else: *************** *** 222,226 **** continue else: ! raise ImportError("unable to find appropriate mx ODBC module") t = self.dbs[("odbc", dbname)] --- 225,229 ---- continue else: ! raise ImportError("unable to find appropriate mxODBC module") t = self.dbs[("odbc", dbname)] *************** *** 267,271 **** if f: self.results = choose(self.results is None, [], self.results) + f s = cursor.nextset() ! if hasattr(cursor, "rowid"): self.rowid = cursor.rowid if hasattr(cursor, "updatecount"): self.updatecount = cursor.updatecount if self.autocommit or cursor is None: self.db.commit() --- 270,274 ---- if f: self.results = choose(self.results is None, [], self.results) + f s = cursor.nextset() ! if hasattr(cursor, "lastrowid"): self.lastrowid = cursor.lastrowid if hasattr(cursor, "updatecount"): self.updatecount = cursor.updatecount if self.autocommit or cursor is None: self.db.commit() |
From: brian z. <bz...@us...> - 2001-12-29 07:17:45
|
Update of /cvsroot/jython/jython/Lib In directory usw-pr-cvs1:/tmp/cvs-serv2705 Modified Files: dbexts.py Log Message: added callproc(), updatecount and rowid Index: dbexts.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/dbexts.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dbexts.py 2001/12/07 04:03:51 1.2 --- dbexts.py 2001/12/29 07:17:42 1.3 *************** *** 78,82 **** # Check row entry lengths output = [] ! headers = map(string.upper, list(headers)) collen = map(len,headers) output.append(headers) --- 78,82 ---- # Check row entry lengths output = [] ! headers = map(string.upper, list(map(lambda x: x or "", headers))) collen = map(len,headers) output.append(headers) *************** *** 180,183 **** --- 180,185 ---- self.formatter = formatter self.out = out + self.rowid = None + self.updatecount = None if not jndiname: *************** *** 265,268 **** --- 267,272 ---- if f: self.results = choose(self.results is None, [], self.results) + f s = cursor.nextset() + if hasattr(cursor, "rowid"): self.rowid = cursor.rowid + if hasattr(cursor, "updatecount"): self.updatecount = cursor.updatecount if self.autocommit or cursor is None: self.db.commit() if cursor: cursor.close() *************** *** 316,319 **** --- 320,332 ---- self.__execute__(sql, params, bindings, maxrows=maxrows) return (self.headers, self.results) + + def callproc(self, procname, params=None, bindings=None, maxrows=None): + """ execute a stored procedure """ + cur = self.begin() + try: + cur.callproc(procname, params=params, bindings=bindings, maxrows=maxrows) + finally: + self.commit(cur) + self.display() def pk(self, table, owner=None, schema=None): |
From: brian z. <bz...@us...> - 2001-12-29 07:16:58
|
Update of /cvsroot/jython/jython/Lib/test/zxjdbc In directory usw-pr-cvs1:/tmp/cvs-serv2592 Modified Files: dbextstest.py sptest.py test.xml zxtest.py Log Message: stored procedure changes Index: dbextstest.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/dbextstest.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbextstest.py 2001/12/14 04:20:03 1.1 --- dbextstest.py 2001/12/29 07:16:55 1.2 *************** *** 101,104 **** --- 101,111 ---- assert len(r) == 2, "expected [2], got [%d]" % (len(r)) + def testUpdateCount(self): + """testing update count""" + + self._insertInto("one", 45) + self.db.raw("delete from one where a > ?", [(12,)]) + self.assertEquals(32, self.db.updatecount) + def testQueryWithMaxRows(self): """testing query with max rows""" *************** *** 225,226 **** --- 232,248 ---- done = bcp.transfer(self.db) assert done == 32, "expecting thirty two rows to be inserted, found [%d]" % (done) + + def testAutocommit(self): + """testing the autocommit functionality""" + for u in (0, 1): + self.db.autocommit = u + try: + self.db.isql("select * from one") + except Exception, e: + fail("failed autocommit query with u=[%d], v=[%d]" % (u, v)) + for v in (0, 1): + self.db.db.autocommit = v + try: + self.db.isql("select * from one") + except Exception, e: + fail("failed autocommit query with u=[%d], v=[%d]" % (u, v)) Index: sptest.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/sptest.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sptest.py 2001/12/21 03:45:27 1.2 --- sptest.py 2001/12/29 07:16:55 1.3 *************** *** 6,21 **** # Copyright (c) 2001 brian zimmer <bz...@zi...> ! import sys ! from zxtest import zxJDBCTest ! from com.ziclix.python.sql import Procedure ! class SPTest(zxJDBCTest): ! """ ! These tests are very specific to Oracle. Eventually support for other engines will ! be available. ! """ def setUp(self): ! zxJDBCTest.setUp(self) c = self.cursor() --- 6,15 ---- # Copyright (c) 2001 brian zimmer <bz...@zi...> ! from zxtest import zxCoreTestCase ! class OracleSPTest(zxCoreTestCase): def setUp(self): ! zxCoreTestCase.setUp(self) c = self.cursor() *************** *** 23,47 **** try: try: ! c.execute("drop table plsqltest") except: self.db.rollback() try: ! c.execute("create table plsqltest (x char(20))") ! c.execute("create or replace procedure procnone is begin insert into plsqltest values ('testing'); end;") ! c.execute("create or replace procedure procin (y in char) is begin insert into plsqltest values (y); end;") ! c.execute("create or replace procedure procout (y out char) is begin y := 'tested'; end;") ! c.execute("create or replace procedure procinout (y out varchar, z in varchar) is begin insert into plsqltest values (z); y := 'tested'; end;") ! c.execute("create or replace function funcnone return char is begin return 'tested'; end;") ! c.execute("create or replace function funcin (y char) return char is begin return y || y; end;") ! c.execute("create or replace function funcout (y out char) return char is begin y := 'tested'; return 'returned'; end;") ! c.execute("create or replace function raisesal (name char, raise number) return number is begin return raise + 100000; end;") self.db.commit() except: self.db.rollback() ! fail("procedure creation failed") self.proc_errors("PROC") self.proc_errors("FUNC") - self.proc_errors("RAISESAL") finally: --- 17,39 ---- try: try: ! c.execute("drop table sptest") except: self.db.rollback() try: ! c.execute("create table sptest (x varchar2(20))") ! c.execute("create or replace procedure procnone is begin insert into sptest values ('testing'); end;") ! c.execute("create or replace procedure procin (y in varchar2) is begin insert into sptest values (y); end;") ! c.execute("create or replace procedure procout (y out varchar2) is begin y := 'tested'; end;") ! c.execute("create or replace procedure procinout (y out varchar2, z in varchar2) is begin insert into sptest values (z); y := 'tested'; end;") ! c.execute("create or replace function funcnone return varchar2 is begin return 'tested'; end;") ! c.execute("create or replace function funcin (y varchar2) return varchar2 is begin return y || y; end;") ! c.execute("create or replace function funcout (y out varchar2) return varchar2 is begin y := 'tested'; return 'returned'; end;") self.db.commit() except: self.db.rollback() ! self.fail("procedure creation failed") self.proc_errors("PROC") self.proc_errors("FUNC") finally: *************** *** 49,58 **** def tearDown(self): ! zxJDBCTest.tearDown(self) def proc_errors(self, name): c = self.cursor() try: ! c.execute("select * from user_errors where name like '%s%%'" % (name)) errors = c.fetchall() try: --- 41,50 ---- def tearDown(self): ! zxCoreTestCase.tearDown(self) def proc_errors(self, name): c = self.cursor() try: ! c.execute("select * from user_errors where name like '%s%%'" % (name.upper())) errors = c.fetchall() try: *************** *** 65,74 **** c.close() def testProcin(self): c = self.cursor() try: ! c.callproc("procin", ("testProcin",)) self.assertEquals(None, c.fetchall()) ! c.execute("select * from plsqltest") self.assertEquals(1, len(c.fetchall())) finally: --- 57,108 ---- c.close() + def testCursor(self): + c = self.cursor() + try: + + c.execute("insert into sptest values ('a')") + c.execute("insert into sptest values ('b')") + c.execute("insert into sptest values ('c')") + c.execute("insert into sptest values ('d')") + c.execute("insert into sptest values ('e')") + + c.execute(""" + CREATE OR REPLACE PACKAGE types + AS + TYPE ref_cursor IS REF CURSOR; + END; + """) + + c.execute(""" + CREATE OR REPLACE FUNCTION funccur(v_x IN VARCHAR) + RETURN types.ref_cursor + AS + funccur_cursor types.ref_cursor; + BEGIN + OPEN funccur_cursor FOR + SELECT x FROM sptest WHERE x < v_x; + RETURN funccur_cursor; + END; + """) + + self.proc_errors("funccur") + + c.callproc("funccur", ("z",)) + data = c.fetchall() + self.assertEquals(5, len(data)) + c.callproc("funccur", ("c",)) + data = c.fetchall() + self.assertEquals(2, len(data)) + + finally: + c.close() + def testProcin(self): c = self.cursor() try: ! params = ["testProcin"] ! c.callproc("procin", params) self.assertEquals(None, c.fetchall()) ! c.execute("select * from sptest") self.assertEquals(1, len(c.fetchall())) finally: *************** *** 78,85 **** c = self.cursor() try: ! c.callproc("procinout", ("testing",)) data = c.fetchone() ! assert data is not None, "data was None" ! self.assertEquals("tested", data[0]) finally: c.close() --- 112,123 ---- c = self.cursor() try: ! params = [None, "testing"] ! c.callproc("procinout", params) data = c.fetchone() ! assert data is None, "data was not None" ! c.execute("select * from sptest") ! data = c.fetchone() ! self.assertEquals("testing", data[0]) ! self.assertEquals("tested", params[0]) finally: c.close() *************** *** 99,103 **** c = self.cursor() try: ! c.callproc("funcin", ("testing",)) self.assertEquals(1, c.rowcount) data = c.fetchone() --- 137,155 ---- c = self.cursor() try: ! params = ["testing"] ! c.callproc("funcin", params) ! self.assertEquals(1, c.rowcount) ! data = c.fetchone() ! assert data is not None, "data was None" ! self.assertEquals(1, len(data)) ! self.assertEquals("testingtesting", data[0]) ! finally: ! c.close() ! ! def testCallingWithKws(self): ! c = self.cursor() ! try: ! params = ["testing"] ! c.callproc("funcin", params=params) self.assertEquals(1, c.rowcount) data = c.fetchone() *************** *** 111,133 **** c = self.cursor() try: ! c.callproc("funcout") data = c.fetchone() assert data is not None, "data was None" ! self.assertEquals(2, len(data)) self.assertEquals("returned", data[0]) ! self.assertEquals("tested", data[1].strip()) finally: c.close() ! def testRaisesalary(self): c = self.cursor() try: ! c.callproc("raisesal", ("jython developer", 18000)) data = c.fetchone() assert data is not None, "data was None" self.assertEquals(1, len(data)) ! self.assertEquals(18000 + 100000, data[0]) finally: c.close() --- 163,238 ---- c = self.cursor() try: ! params = [None] ! c.callproc("funcout", params) data = c.fetchone() assert data is not None, "data was None" ! self.assertEquals(1, len(data)) self.assertEquals("returned", data[0]) ! self.assertEquals("tested", params[0].strip()) finally: c.close() ! def testMultipleFetch(self): ! """testing the second fetch call to a callproc() is None""" c = self.cursor() try: ! c.callproc("funcnone") data = c.fetchone() assert data is not None, "data was None" + data = c.fetchone() + assert data is None, "data was not None" + finally: + c.close() + + class SQLServerSPTest(zxCoreTestCase): + + def testProcWithResultSet(self): + c = self.cursor() + try: + c.execute("use ziclix") + + self.assertEquals("ziclix", c.connection.__connection__.getCatalog()) + + try: + c.execute("drop table sptest") + except: + pass + + c.execute("create table sptest (a int, b varchar(32))") + c.execute("insert into sptest values (1, 'hello')") + c.execute("insert into sptest values (2, 'there')") + c.execute("insert into sptest values (3, 'goodbye')") + + try: + c.execute("drop procedure sp_proctest") + except: + pass + + c.execute(""" + create procedure sp_proctest (@A int) + as + select a, b from sptest where a <= @A + """) + + c.callproc(("ziclix", "jython", "sp_proctest"), (2,)) + data = c.fetchall() + self.assertEquals(2, len(data)) + self.assertEquals(2, len(c.description)) + assert c.nextset() is not None, "expected an additional result set" + data = c.fetchall() self.assertEquals(1, len(data)) ! self.assertEquals(1, len(c.description)) finally: c.close() + def testSalesByCategory(self): + c = self.cursor() + try: + c.execute("use northwind") + c.callproc(("northwind", "dbo", "SalesByCategory"), ["Seafood", "1998"]) + data = c.fetchall() + assert data is not None, "no results from SalesByCategory" + assert len(data) > 0, "expected numerous results" + finally: + c.close() Index: test.xml =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/test.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test.xml 2001/12/21 21:06:34 1.4 --- test.xml 2001/12/29 07:16:55 1.5 *************** *** 19,27 **** <argument name="driver" value="org.postgresql.Driver"/> </factory> ! <testcase from="zxtest" import="zxCoreTest"> <!-- Returns any empty ResultSet every time. --> <ignore name="testIndexInfo"/> </testcase> ! <testcase from="zxtest" import="BCPTest"/> <testcase from="dbextstest" import="dbextsTestCase"/> </test> --- 19,27 ---- <argument name="driver" value="org.postgresql.Driver"/> </factory> ! <testcase from="zxtest" import="zxAPITestCase"> <!-- Returns any empty ResultSet every time. --> <ignore name="testIndexInfo"/> </testcase> ! <testcase from="zxtest" import="BCPTestCase"/> <testcase from="dbextstest" import="dbextsTestCase"/> </test> *************** *** 36,43 **** <keyword name="portNumber" value="5432" type="int"/> </factory> ! <testcase from="zxtest" import="zxCoreTest"> <ignore name="testIndexInfo"/> </testcase> ! <testcase from="zxtest" import="BCPTest"/> </test> --> --- 36,43 ---- <keyword name="portNumber" value="5432" type="int"/> </factory> ! <testcase from="zxtest" import="zxAPITestCase"> <ignore name="testIndexInfo"/> </testcase> ! <testcase from="zxtest" import="BCPTestCase"/> </test> --> *************** *** 79,84 **** <argument name="driver" value="org.gjt.mm.mysql.Driver"/> </factory> ! <testcase from="zxtest" import="zxCoreTest"/> ! <testcase from="zxtest" import="BCPTest"/> <testcase from="dbextstest" import="dbextsTestCase"/> </test> --- 79,84 ---- <argument name="driver" value="org.gjt.mm.mysql.Driver"/> </factory> ! <testcase from="zxtest" import="zxAPITestCase"/> ! <testcase from="zxtest" import="BCPTestCase"/> <testcase from="dbextstest" import="dbextsTestCase"/> </test> *************** *** 92,97 **** <keyword name="port" value="3306" type="int"/> </factory> ! <testcase from="zxtest" import="zxCoreTest"/> ! <testcase from="zxtest" import="BCPTest"/> </test> <!-- --- 92,97 ---- <keyword name="port" value="3306" type="int"/> </factory> ! <testcase from="zxtest" import="zxAPITestCase"/> ! <testcase from="zxtest" import="BCPTestCase"/> </test> <!-- *************** *** 101,106 **** <keyword name="INITIAL_CONTEXT_FACTORY" value="com.sun.jndi.fscontext.RefFSContextFactory"/> </factory> ! <testcase from="zxtest" import="zxCoreTest"/> ! <testcase from="zxtest" import="BCPTest"/> </test> --> --- 101,106 ---- <keyword name="INITIAL_CONTEXT_FACTORY" value="com.sun.jndi.fscontext.RefFSContextFactory"/> </factory> ! <testcase from="zxtest" import="zxAPITestCase"/> ! <testcase from="zxtest" import="BCPTestCase"/> </test> --> *************** *** 139,148 **** <argument name="driver" value="oracle.jdbc.driver.OracleDriver"/> </factory> ! <testcase from="zxtest" import="zxCoreTest"> <ignore name="testRowid"/> </testcase> ! <testcase from="zxtest" import="BCPTest"/> <testcase from="dbextstest" import="dbextsTestCase"/> ! <testcase from="sptest" import="SPTest"/> </test> <!-- --- 139,148 ---- <argument name="driver" value="oracle.jdbc.driver.OracleDriver"/> </factory> ! <testcase from="zxtest" import="zxAPITestCase"> <ignore name="testRowid"/> </testcase> ! <testcase from="zxtest" import="BCPTestCase"/> <testcase from="dbextstest" import="dbextsTestCase"/> ! <testcase from="sptest" import="OracleSPTest"/> </test> <!-- *************** *** 154,161 **** <keyword name="password" value="jython"/> </factory> ! <testcase from="zxtest" import="zxCoreTest"> <ignore name="testRowid"/> </testcase> ! <testcase from="zxtest" import="BCPTest"/> </test> --> --- 154,162 ---- <keyword name="password" value="jython"/> </factory> ! <testcase from="zxtest" import="zxAPITestCase"> <ignore name="testRowid"/> </testcase> ! <testcase from="zxtest" import="BCPTestCase"/> ! <testcase from="sptest" import="OracleSPTest"/> </test> --> *************** *** 185,188 **** --- 186,248 ---- </table> </vendor> + <vendor name="microsoft" + datahandler="com.ziclix.python.sql.handler.SQLServerDataHandler"> + <test name="opta driver" os="java"> + <factory class="com.ziclix.python.sql.zxJDBC" method="connect"> + <argument name="url" value="jdbc:inetdae7:localhost:1433?database=ziclix"/> + <argument name="usr" value="jython"/> + <argument name="pwd" value="jython"/> + <argument name="driver" value="com.inet.tds.TdsDriver"/> + </factory> + <!-- + <testcase from="zxtest" import="zxAPITestCase"> + <ignore name="testRowid"/> + </testcase> + <testcase from="dbextstest" import="dbextsTestCase"> + <ignore name="testBulkcopy"/> + <ignore name="testBulkcopyWithDynamicColumns"/> + </testcase> + --> + <testcase from="sptest" import="SQLServerSPTest"/> + </test> + <test name="microsoft driver" os="java"> + <factory class="com.ziclix.python.sql.zxJDBC" method="connect"> + <argument name="url" value="jdbc:microsoft:sqlserver://localhost:1433"/> + <argument name="usr" value="jython"/> + <argument name="pwd" value="jython"/> + <argument name="driver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/> + </factory> + <!-- + <testcase from="zxtest" import="zxAPITestCase"> + <ignore name="testRowid"/> + </testcase> + <testcase from="zxtest" import="BCPTestCase"/> + <testcase from="dbextstest" import="dbextsTestCase"/> + <testcase from="sptest" import="SQLServerSPTest"/> + --> + </test> + <table ref="texttable" name="c_texttable"> + create table c_texttable (a int not null, primary key(a), b text not null) + </table> + <table ref="floattable" name="c_floattable"> + create table c_floattable (a int, b numeric(5,2)) + </table> + <table ref="datetable" name="c_datetable"> + create table c_datetable (a int, b datetime) + </table> + <table ref="timetable" name="c_timetable"> + create table c_timetable (a int, b datetime) + </table> + <table ref="timestamptable" name="c_timestamptable"> + create table c_timestamptable (a int, b datetime) + </table> + <table ref="blobtable" name="b_blobtable"> + create table b_blobtable (a int, b blob) + </table> + <table ref="pktable" name="b_pktable"> + create table b_pktable (a int not null, b int, primary key(a)) + </table> + </vendor> + <!-- <vendor name="cloudscape" datahandler="com.ziclix.python.sql.JDBC20DataHandler"> *************** *** 194,201 **** <argument name="driver" value="COM.cloudscape.core.JDBCDriver"/> </factory> ! <testcase from="zxtest" import="zxCoreTest"> <ignore name="testRowid"/> </testcase> ! <testcase from="zxtest" import="BCPTest"/> <testcase from="dbextstest" import="dbextsTestCase"/> </test> --- 254,261 ---- <argument name="driver" value="COM.cloudscape.core.JDBCDriver"/> </factory> ! <testcase from="zxtest" import="zxAPITestCase"> <ignore name="testRowid"/> </testcase> ! <testcase from="zxtest" import="BCPTestCase"/> <testcase from="dbextstest" import="dbextsTestCase"/> </test> *************** *** 221,227 **** create table b_pktable (a int not null, b int, primary key(a)) </table> - <table ref="autoincrementtable" name="aitable"> - create table aitable (a int with default autoincrement not null, b int, primary key(a)) - </table> </vendor> </tests> --- 281,285 ---- create table b_pktable (a int not null, b int, primary key(a)) </table> </vendor> + --> </tests> Index: zxtest.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/zxtest.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** zxtest.py 2001/12/21 03:45:27 1.3 --- zxtest.py 2001/12/29 07:16:55 1.4 *************** *** 11,15 **** import tempfile, os, time, runner ! class zxJDBCTest(runner.SQLTestCase): def connect(self): --- 11,24 ---- import tempfile, os, time, runner ! class zxCoreTestCase(runner.SQLTestCase): ! ! def setUp(self): ! runner.SQLTestCase.setUp(self) ! self.db = self.connect() ! self.db.autocommit = 0 ! ! def tearDown(self): ! self.db.close() ! runner.SQLTestCase.tearDown(self) def connect(self): *************** *** 25,30 **** return c def setUp(self): ! runner.SQLTestCase.setUp(self) self.db = self.connect() self.db.autocommit = 0 --- 34,41 ---- return c + class zxJDBCTestCase(zxCoreTestCase): + def setUp(self): ! zxCoreTestCase.setUp(self) self.db = self.connect() self.db.autocommit = 0 *************** *** 61,70 **** c.close() ! try: ! self.db.close() ! finally: ! self.db = None ! class zxCoreTest(zxJDBCTest): def testConnection(self): --- 72,78 ---- c.close() ! zxCoreTestCase.tearDown(self) ! class zxAPITestCase(zxJDBCTestCase): def testConnection(self): *************** *** 72,75 **** --- 80,91 ---- assert self.db, "invalid connection" + def testAutocommit(self): + """testing autocommit functionality""" + if self.db.__connection__.getMetaData().supportsTransactions(): + self.db.autocommit = 1 + self.assertEquals(1, self.db.__connection__.getAutoCommit()) + self.db.autocommit = 0 + self.assertEquals(0, self.db.__connection__.getAutoCommit()) + def testSimpleQuery(self): """testing simple queries with cursor.execute(), no parameters""" *************** *** 172,191 **** assert self.has_table("texttable"), "missing attribute texttable" fp = open(tempfile.mktemp(), "w") try: ! c = self.cursor() ! c.execute(self.table("texttable")[1]) ! data = fp.name * 300 ! data = data[:3500] ! fp.write(data) ! fp.flush() ! fp.close() ! fp = open(fp.name, "r") ! c.execute("insert into %s (a, b) values (?, ?)" % (self.table("texttable")[0]), [(0, fp)], {1:zxJDBC.LONGVARCHAR}) ! self.db.commit() ! c.execute("select b from %s" % (self.table("texttable")[0])) ! f = c.fetchall() ! assert len(f) == 1, "expected [1] row, got [%d]" % (len(f)) ! assert len(f[0][0]) == len(data), "expected [%d], got [%d]" % (len(data), len(f[0][0])) ! assert data == f[0][0], "failed to retrieve the same text as inserted" finally: c.execute("drop table %s" % (self.table("texttable")[0])) --- 188,211 ---- assert self.has_table("texttable"), "missing attribute texttable" fp = open(tempfile.mktemp(), "w") + c = self.cursor() try: ! try: ! c.execute(self.table("texttable")[1]) ! data = fp.name * 300 ! data = data[:3500] ! fp.write(data) ! fp.flush() ! fp.close() ! fp = open(fp.name, "r") ! c.execute("insert into %s (a, b) values (?, ?)" % (self.table("texttable")[0]), [(0, fp)], {1:zxJDBC.LONGVARCHAR}) ! self.db.commit() ! c.execute("select b from %s" % (self.table("texttable")[0])) ! f = c.fetchall() ! assert len(f) == 1, "expected [1] row, got [%d]" % (len(f)) ! assert len(f[0][0]) == len(data), "expected [%d], got [%d]" % (len(data), len(f[0][0])) ! assert data == f[0][0], "failed to retrieve the same text as inserted" ! except Exception, e: ! print e ! raise e finally: c.execute("drop table %s" % (self.table("texttable")[0])) *************** *** 577,589 **** c.close() ! class LOBTest(zxJDBCTest): def __blob(self, obj=0): assert self.has_table("blobtable"), "no blob table" - c = self.cursor() tabname, sql = self.table("blobtable") fn = tempfile.mktemp() fp = None try: --- 597,609 ---- c.close() ! class LOBTest(zxJDBCTestCase): def __blob(self, obj=0): assert self.has_table("blobtable"), "no blob table" tabname, sql = self.table("blobtable") fn = tempfile.mktemp() fp = None + c = self.cursor() try: *************** *** 640,646 **** def __clob(self, asfile=0): assert self.has_table("clobtable"), "no clob table" - c = self.cursor() tabname, sql = self.table("clobtable") try: hello = "hello" * 1024 * 10 --- 660,666 ---- def __clob(self, asfile=0): assert self.has_table("clobtable"), "no clob table" tabname, sql = self.table("clobtable") + c = self.cursor() try: hello = "hello" * 1024 * 10 *************** *** 680,684 **** self.__clob(1) ! class BCPTest(zxJDBCTest): def testCSVPipe(self): --- 700,704 ---- self.__clob(1) ! class BCPTestCase(zxJDBCTestCase): def testCSVPipe(self): |
From: brian z. <bz...@us...> - 2001-12-29 07:16:23
|
Update of /cvsroot/jython/jython/com/ziclix/python/sql In directory usw-pr-cvs1:/tmp/cvs-serv2506/ziclix/python/sql Modified Files: DataHandler.java Fetch.java Procedure.java PyCursor.java Log Message: stored procedure changes Index: DataHandler.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/DataHandler.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DataHandler.java 2001/12/21 03:44:55 1.4 --- DataHandler.java 2001/12/29 07:16:20 1.5 *************** *** 55,58 **** --- 55,79 ---- /** + * Method getProcedureName + * + * @param PyObject catalog + * @param PyObject schema + * @param PyObject name + * + * @return String + * + */ + public String getProcedureName(PyObject catalog, PyObject schema, PyObject name) { + + StringBuffer procName = new StringBuffer(); + + if ((catalog != Py.EmptyString) && (catalog != Py.None)) { + procName.append(catalog.toString()).append("."); + } + + return procName.append(name.toString()).toString(); + } + + /** * Returns the row id of the last executed statement. * *************** *** 93,97 **** */ public void setJDBCObject(PreparedStatement stmt, int index, PyObject object) throws SQLException { ! stmt.setObject(index, object.__tojava__(Object.class)); } --- 114,133 ---- */ public void setJDBCObject(PreparedStatement stmt, int index, PyObject object) throws SQLException { ! ! try { ! stmt.setObject(index, object.__tojava__(Object.class)); ! } catch (Exception e) { ! SQLException cause = null, ex = new SQLException("error setting index [" + index + "]"); ! ! if (e instanceof SQLException) { ! cause = (SQLException)e; ! } else { ! cause = new SQLException(e.getMessage()); ! } ! ! ex.setNextException(cause); ! ! throw ex; ! } } *************** *** 220,225 **** case Types.NUMERIC : case Types.DECIMAL : ! BigDecimal bd = set.getBigDecimal(col, 10); obj = (bd == null) ? Py.None : Py.newFloat(bd.doubleValue()); break; --- 256,267 ---- case Types.NUMERIC : case Types.DECIMAL : ! BigDecimal bd = null; + try { + bd = set.getBigDecimal(col, set.getMetaData().getPrecision(col)); + } catch (Exception e) { + bd = set.getBigDecimal(col, 10); + } + obj = (bd == null) ? Py.None : Py.newFloat(bd.doubleValue()); break; *************** *** 375,384 **** * @param int colType the column as from DatabaseMetaData (eg, procedureColumnOut) * @param int dataType the JDBC datatype from Types * * @throws SQLException * */ ! public void registerOut(CallableStatement statement, int index, int colType, int dataType) throws SQLException { ! statement.registerOutParameter(index, dataType); } --- 417,442 ---- * @param int colType the column as from DatabaseMetaData (eg, procedureColumnOut) * @param int dataType the JDBC datatype from Types + * @param String dataTypeName the JDBC datatype name * * @throws SQLException * */ ! public void registerOut(CallableStatement statement, int index, int colType, int dataType, String dataTypeName) throws SQLException { ! ! try { ! statement.registerOutParameter(index, dataType); ! } catch (Exception e) { ! SQLException cause = null, ex = new SQLException("error setting index [" + index + "], coltype [" + colType + "], datatype [" + dataType + "], datatypename [" + dataTypeName + "]"); ! ! if (e instanceof SQLException) { ! cause = (SQLException)e; ! } else { ! cause = new SQLException(e.getMessage()); ! } ! ! ex.setNextException(cause); ! ! throw ex; ! } } Index: Fetch.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/Fetch.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Fetch.java 2001/12/21 03:44:55 1.3 --- Fetch.java 2001/12/29 07:16:20 1.4 *************** *** 48,57 **** protected PyObject description; - /** True if a CallableStatement was added, false otherwise. */ - protected boolean callable; - - /** Field callableResults */ - protected PyObject callableResults; - /** * Constructor Fetch --- 48,51 ---- *************** *** 65,70 **** this.description = Py.None; this.rowcount = -1; - this.callable = false; - this.callableResults = Py.None; } --- 59,62 ---- *************** *** 118,165 **** * @param CallableStatement callableStatement * @param Procedure procedure * */ ! public void add(CallableStatement callableStatement, Procedure procedure) { ! ! // set this regardless of whether the statement has results ! this.callable = true; ! ! try { ! createDescription(procedure); ! ! if (description.__len__() == 0) { ! return; ! } ! ! PyObject[] row = new PyObject[description.__len__()]; ! ! for (int i = 0, j = 0, len = procedure.columns.__len__(); i < len; i++) { ! PyObject column = procedure.columns.__getitem__(i); ! int colType = column.__getitem__(Procedure.COLUMN_TYPE).__int__().getValue(); ! int dataType = column.__getitem__(Procedure.DATA_TYPE).__int__().getValue(); ! ! switch (colType) { ! ! case DatabaseMetaData.procedureColumnOut : ! case DatabaseMetaData.procedureColumnInOut : ! case DatabaseMetaData.procedureColumnReturn : ! row[j++] = cursor.getDataHandler().getPyObject(callableStatement, i + 1, dataType); ! break; ! } ! } ! ! this.callableResults = new PyList(); ! ! ((PyList)this.callableResults).append(new PyTuple(row)); ! ! this.rowcount = this.callableResults.__len__(); ! } catch (PyException e) { ! throw e; ! } catch (Exception e) { ! throw zxJDBC.newError(e); ! } ! ! return; ! } /** --- 110,117 ---- * @param CallableStatement callableStatement * @param Procedure procedure + * @param PyObject params * */ ! abstract public void add(CallableStatement callableStatement, Procedure procedure, PyObject params); /** *************** *** 193,216 **** * @return a sequence of sequences from the result set, or None when no more data is available */ ! public final PyObject fetchall() { ! ! if (callable) { ! PyObject tmp = this.callableResults; ! ! this.callableResults = Py.None; ! ! return tmp; ! } else { ! return doFetchall(); ! } ! } ! ! /** ! * Method doFetchall ! * ! * @return PyObject ! * ! */ ! abstract protected PyObject doFetchall(); /** --- 145,149 ---- * @return a sequence of sequences from the result set, or None when no more data is available */ ! public abstract PyObject fetchall(); /** *************** *** 234,260 **** * * @return a sequence of sequences from the result set, or None when no more data is available - */ - public final PyObject fetchmany(int size) { - - if (callable) { - PyObject tmp = this.callableResults; - - this.callableResults = Py.None; - - return tmp; - } else { - return doFetchmany(size); - } - } - - /** - * Method doFetchmany - * - * @param int size - * - * @return PyObject - * */ ! abstract protected PyObject doFetchmany(int size); /** --- 167,172 ---- * * @return a sequence of sequences from the result set, or None when no more data is available */ ! public abstract PyObject fetchmany(int size); /** *************** *** 262,297 **** * * @return true if more sets exist, else None - */ - public final PyObject nextset() { - - // no support for result sets within callable statements - return callable ? Py.None : doNextset(); - } - - /** - * Method doNextset - * - * @return PyObject - * */ ! abstract protected PyObject doNextset(); /** * Cleanup any resources. - */ - public final void close() throws SQLException { - - doClose(); - - this.callableResults = Py.None; - } - - /** - * Method doClose - * - * @throws SQLException - * */ ! abstract public void doClose() throws SQLException; /** --- 174,184 ---- * * @return true if more sets exist, else None */ ! public abstract PyObject nextset(); /** * Cleanup any resources. */ ! public abstract void close() throws SQLException; /** *************** *** 302,308 **** * precision and scale are only available for numeric types */ ! protected void createDescription(ResultSetMetaData meta) throws SQLException { ! this.description = new PyList(); for (int i = 1; i <= meta.getColumnCount(); i++) { --- 189,195 ---- * precision and scale are only available for numeric types */ ! protected PyObject createDescription(ResultSetMetaData meta) throws SQLException { ! PyObject metadata = new PyList(); for (int i = 1; i <= meta.getColumnCount(); i++) { *************** *** 335,340 **** a[6] = Py.newInteger(meta.isNullable(i)); ! ((PyList)this.description).append(new PyTuple(a)); } } --- 222,229 ---- a[6] = Py.newInteger(meta.isNullable(i)); ! ((PyList)metadata).append(new PyTuple(a)); } + + return metadata; } *************** *** 346,352 **** * precision and scale are only available for numeric types */ ! protected void createDescription(Procedure procedure) throws SQLException { ! this.description = new PyList(); for (int i = 0, len = procedure.columns.__len__(); i < len; i++) { --- 235,241 ---- * precision and scale are only available for numeric types */ ! protected PyObject createDescription(Procedure procedure) throws SQLException { ! PyObject metadata = new PyList(); for (int i = 0, len = procedure.columns.__len__(); i < len; i++) { *************** *** 356,361 **** switch (colType) { - case DatabaseMetaData.procedureColumnOut : - case DatabaseMetaData.procedureColumnInOut : case DatabaseMetaData.procedureColumnReturn : PyObject[] a = new PyObject[7]; --- 245,248 ---- *************** *** 389,396 **** a[6] = (nullable == DatabaseMetaData.procedureNullable) ? Py.One : Py.Zero; ! ((PyList)this.description).append(new PyTuple(a)); break; } } } --- 276,342 ---- a[6] = (nullable == DatabaseMetaData.procedureNullable) ? Py.One : Py.Zero; ! ((PyList)metadata).append(new PyTuple(a)); ! break; ! } ! } ! ! return metadata; ! } ! ! /** ! * Method createResults ! * ! * @param CallableStatement callableStatement ! * @param Procedure procedure ! * @param PyObject params ! * ! * @return PyObject ! * ! * @throws SQLException ! * ! */ ! protected PyObject createResults(CallableStatement callableStatement, Procedure procedure, PyObject params) throws SQLException { ! ! PyList results = new PyList(); ! ! for (int i = 0, j = 0, len = procedure.columns.__len__(); i < len; i++) { ! PyObject obj = Py.None; ! PyObject column = procedure.columns.__getitem__(i); ! int colType = column.__getitem__(Procedure.COLUMN_TYPE).__int__().getValue(); ! int dataType = column.__getitem__(Procedure.DATA_TYPE).__int__().getValue(); ! ! switch (colType) { ! ! case DatabaseMetaData.procedureColumnOut : ! case DatabaseMetaData.procedureColumnInOut : ! obj = cursor.getDataHandler().getPyObject(callableStatement, i + 1, dataType); ! ! params.__setitem__(j++, obj); ! break; ! ! case DatabaseMetaData.procedureColumnReturn : ! obj = cursor.getDataHandler().getPyObject(callableStatement, i + 1, dataType); ! ! // Oracle sends ResultSets as a return value ! Object rs = obj.__tojava__(ResultSet.class); ! ! if (rs == Py.NoConversion) { ! results.append(obj); ! } else { ! add((ResultSet)rs); ! } break; } } + + if (results.__len__() == 0) { + return Py.None; + } + + PyList ret = new PyList(); + + ret.append(__builtin__.tuple(results)); + + return ret; } *************** *** 403,407 **** * @throws SQLException */ ! protected PyList createResults(ResultSet set, Set skipCols) throws SQLException { PyObject tuple = Py.None; --- 349,353 ---- * @throws SQLException */ ! protected PyList createResults(ResultSet set, Set skipCols, PyObject metaData) throws SQLException { PyObject tuple = Py.None; *************** *** 409,413 **** while (set.next()) { ! tuple = createResult(set, skipCols); res.append(tuple); --- 355,359 ---- while (set.next()) { ! tuple = createResult(set, skipCols, metaData); res.append(tuple); *************** *** 425,431 **** * @throws SQLException */ ! protected PyTuple createResult(ResultSet set, Set skipCols) throws SQLException { ! int descriptionLength = description.__len__(); PyObject[] row = new PyObject[descriptionLength]; --- 371,377 ---- * @throws SQLException */ ! protected PyTuple createResult(ResultSet set, Set skipCols, PyObject metaData) throws SQLException { ! int descriptionLength = metaData.__len__(); PyObject[] row = new PyObject[descriptionLength]; *************** *** 434,438 **** row[i] = Py.None; } else { ! int type = ((PyInteger)description.__getitem__(i).__getitem__(1)).getValue(); row[i] = this.cursor.getDataHandler().getPyObject(set, i + 1, type); --- 380,384 ---- row[i] = Py.None; } else { ! int type = ((PyInteger)metaData.__getitem__(i).__getitem__(1)).getValue(); row[i] = this.cursor.getDataHandler().getPyObject(set, i + 1, type); *************** *** 442,446 **** this.cursor.addWarning(set.getWarnings()); ! return new PyTuple(row); } --- 388,394 ---- this.cursor.addWarning(set.getWarnings()); ! PyTuple tuple = new PyTuple(row); ! ! return tuple; } *************** *** 477,480 **** --- 425,431 ---- protected List results; + /** Field descriptions */ + protected List descriptions; + /** * Construct a static fetch. The entire result set is iterated as it *************** *** 486,489 **** --- 437,441 ---- this.results = new LinkedList(); + this.descriptions = new LinkedList(); this.counter = -1; } *************** *** 508,524 **** public void add(ResultSet resultSet, Set skipCols) { - PyObject result = Py.None; - try { if ((resultSet != null) && (resultSet.getMetaData() != null)) { ! if (this.description == Py.None) { ! this.createDescription(resultSet.getMetaData()); ! } ! ! result = this.createResults(resultSet, skipCols); this.results.add(result); this.rowcount = ((PyObject)this.results.get(0)).__len__(); } } catch (PyException e) { --- 460,476 ---- public void add(ResultSet resultSet, Set skipCols) { try { if ((resultSet != null) && (resultSet.getMetaData() != null)) { ! PyObject metadata = this.createDescription(resultSet.getMetaData()); ! PyObject result = this.createResults(resultSet, skipCols, metadata); this.results.add(result); + this.descriptions.add(metadata); + // we want the rowcount of the first result set this.rowcount = ((PyObject)this.results.get(0)).__len__(); + + // we want the description of the first result set + this.description = ((PyObject)this.descriptions.get(0)); } } catch (PyException e) { *************** *** 534,537 **** --- 486,519 ---- /** + * Method add + * + * @param CallableStatement callableStatement + * @param Procedure procedure + * @param PyObject params + * + */ + public void add(CallableStatement callableStatement, Procedure procedure, PyObject params) { + + try { + PyObject result = this.createResults(callableStatement, procedure, params); + + if (result != Py.None) { + this.results.add(result); + this.descriptions.add(this.createDescription(procedure)); + + // we want the description of the first result set + this.description = ((PyObject)this.descriptions.get(0)); + + // we want the rowcount of the first result set + this.rowcount = ((PyObject)this.results.get(0)).__len__(); + } + } catch (PyException e) { + throw e; + } catch (Exception e) { + throw zxJDBC.newError(e); + } + } + + /** * Fetch all (remaining) rows of a query result, returning them as a sequence * of sequences (e.g. a list of tuples). Note that the cursor's arraysize attribute *************** *** 543,547 **** * @return a sequence of sequences from the result set, or None when no more data is available */ ! public PyObject doFetchall() { return fetchmany(this.rowcount); } --- 525,529 ---- * @return a sequence of sequences from the result set, or None when no more data is available */ ! public PyObject fetchall() { return fetchmany(this.rowcount); } *************** *** 568,572 **** * @return a sequence of sequences from the result set, or None when no more data is available */ ! public PyObject doFetchmany(int size) { PyObject res = Py.None, current = Py.None; --- 550,554 ---- * @return a sequence of sequences from the result set, or None when no more data is available */ ! public PyObject fetchmany(int size) { PyObject res = Py.None, current = Py.None; *************** *** 597,601 **** * @return true if more sets exist, else None */ ! public PyObject doNextset() { PyObject next = Py.None; --- 579,583 ---- * @return true if more sets exist, else None */ ! public PyObject nextset() { PyObject next = Py.None; *************** *** 603,608 **** --- 585,592 ---- if ((results != null) && (results.size() > 1)) { this.results.remove(0); + this.descriptions.remove(0); next = (PyObject)this.results.get(0); + this.description = (PyObject)this.descriptions.get(0); this.rowcount = next.__len__(); this.counter = -1; *************** *** 615,619 **** * Remove the results. */ ! public void doClose() throws SQLException { this.counter = -1; --- 599,603 ---- * Remove the results. */ ! public void close() throws SQLException { this.counter = -1; *************** *** 672,676 **** if ((resultSet != null) && (resultSet.getMetaData() != null)) { if (this.description == Py.None) { ! this.createDescription(resultSet.getMetaData()); } --- 656,660 ---- if ((resultSet != null) && (resultSet.getMetaData() != null)) { if (this.description == Py.None) { ! this.description = this.createDescription(resultSet.getMetaData()); } *************** *** 686,692 **** /** * Iterate the remaining contents of the ResultSet and return. */ ! public PyObject doFetchall() { return fetch(0, true); } --- 670,688 ---- /** + * Method add + * + * @param CallableStatement callableStatement + * @param Procedure procedure + * @param PyObject params + * + */ + public void add(CallableStatement callableStatement, Procedure procedure, PyObject params) { + return; + } + + /** * Iterate the remaining contents of the ResultSet and return. */ ! public PyObject fetchall() { return fetch(0, true); } *************** *** 695,699 **** * Iterate up to size rows remaining in the ResultSet and return. */ ! public PyObject doFetchmany(int size) { return fetch(size, false); } --- 691,695 ---- * Iterate up to size rows remaining in the ResultSet and return. */ ! public PyObject fetchmany(int size) { return fetch(size, false); } *************** *** 717,721 **** while (((size-- > 0) || all) && this.resultSet.next()) { ! PyTuple tuple = createResult(this.resultSet, this.skipCols); res.append(tuple); --- 713,717 ---- while (((size-- > 0) || all) && this.resultSet.next()) { ! PyTuple tuple = createResult(this.resultSet, this.skipCols, this.description); res.append(tuple); *************** *** 736,740 **** * Always returns None. */ ! public PyObject doNextset() { return Py.None; } --- 732,736 ---- * Always returns None. */ ! public PyObject nextset() { return Py.None; } *************** *** 743,747 **** * Close the underlying ResultSet. */ ! public void doClose() throws SQLException { if (this.resultSet == null) { --- 739,743 ---- * Close the underlying ResultSet. */ ! public void close() throws SQLException { if (this.resultSet == null) { Index: Procedure.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/Procedure.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Procedure.java 2001/12/21 21:17:32 1.3 --- Procedure.java 2001/12/29 07:16:20 1.4 *************** *** 11,14 **** --- 11,15 ---- import java.sql.*; + import java.util.BitSet; import org.python.core.*; *************** *** 31,34 **** --- 32,38 ---- protected static final int DATA_TYPE = 5; + /** Field DATA_TYPE_NAME */ + protected static final int DATA_TYPE_NAME = 6; + /** Field PRECISION */ protected static final int PRECISION = 7; *************** *** 49,58 **** protected PyCursor cursor; - /** Field name */ - protected PyObject name; - /** Field columns */ protected PyObject columns; /** * Constructor Procedure --- 53,71 ---- protected PyCursor cursor; /** Field columns */ protected PyObject columns; + /** Field procedureCatalog */ + protected PyObject procedureCatalog; + + /** Field procedureSchema */ + protected PyObject procedureSchema; + + /** Field procedureName */ + protected PyObject procedureName; + + /** Field inputSet */ + protected BitSet inputSet; + /** * Constructor Procedure *************** *** 61,72 **** * @param PyObject name a string or tuple representing the name * */ ! public Procedure(PyCursor cursor, PyObject name) { this.cursor = cursor; ! this.name = name; } /** ! * Method prepareCall * * @return CallableStatement --- 74,108 ---- * @param PyObject name a string or tuple representing the name * + * @throws SQLException + * */ ! public Procedure(PyCursor cursor, PyObject name) throws SQLException { ! this.cursor = cursor; ! this.inputSet = new BitSet(); ! ! if (name instanceof PyString) { ! this.procedureCatalog = Py.EmptyString; ! this.procedureSchema = Py.EmptyString; ! this.procedureName = name; ! } else if (this.cursor.isSeq(name)) { ! if (name.__len__() == 3) { ! this.procedureCatalog = name.__getitem__(0); ! this.procedureSchema = name.__getitem__(1); ! this.procedureName = name.__getitem__(2); ! } else { ! ! // throw an exception ! } ! } else { ! ! // throw an exception ! } ! ! fetchColumns(); } /** ! * Prepares the statement and registers the OUT/INOUT parameters (if any). * * @return CallableStatement *************** *** 82,94 **** try { - // fetch the column information - fetchColumns(); - // build the full call syntax ! String sqlString = buildSql(); statement = cursor.connection.connection.prepareCall(sqlString); ! // register the OUT parameters registerOutParameters(statement); } catch (SQLException e) { --- 118,127 ---- try { // build the full call syntax ! String sqlString = toSql(); statement = cursor.connection.connection.prepareCall(sqlString); ! // prepare the OUT parameters registerOutParameters(statement); } catch (SQLException e) { *************** *** 106,134 **** /** ! * Construct a list of the params in the proper order for the .setXXX methods of ! * a PreparedStatement. In the special case for a CallableStatement, insert ! * Procedure.PLACEHOLDER to notify the cursor to skip the slot. * * @param params a non-None list of params ! * ! * @return PyObject a list of params with Procedure.PLACEHOLDER in index for all ! * non IN and INOUT parameters * */ ! public PyObject normalizeParams(PyObject params) { ! ! if (params == Py.None) { ! return Py.None; ! } ! if (columns == Py.None) { ! throw zxJDBC.makeException(zxJDBC.ProgrammingError, "too many params for input"); } ! int j = 0, plen = params.__len__(); ! PyList population = new PyList(); ! ! for (int i = 0, len = columns.__len__(); i < len; i++) { ! PyObject column = columns.__getitem__(i); int colType = column.__getitem__(COLUMN_TYPE).__int__().getValue(); --- 139,157 ---- /** ! * Prepare the binding dictionary with the correct datatypes. * * @param params a non-None list of params ! * @param bindings a dictionary of bindings * */ ! public void normalizeInput(PyObject params, PyObject bindings) throws SQLException { ! if (this.columns == Py.None) { ! return; } ! // do nothing with params at the moment ! for (int i = 0, len = this.columns.__len__(), binding = 0; i < len; i++) { ! PyObject column = this.columns.__getitem__(i); int colType = column.__getitem__(COLUMN_TYPE).__int__().getValue(); *************** *** 137,158 **** case DatabaseMetaData.procedureColumnIn : case DatabaseMetaData.procedureColumnInOut : - if (j + 1 > plen) { - throw zxJDBC.makeException(zxJDBC.ProgrammingError, "too few params for input, attempting [" + (j + 1) + "] found [" + plen + "]"); - } ! population.append(params.__getitem__(j++)); ! break; ! default : ! population.append(PLACEHOLDER); break; } } ! ! if (j != plen) { ! throw zxJDBC.makeException(zxJDBC.ProgrammingError, "too many params for input"); ! } ! return population; } --- 160,195 ---- case DatabaseMetaData.procedureColumnIn : case DatabaseMetaData.procedureColumnInOut : ! // bindings are Python-indexed ! PyInteger key = Py.newInteger(binding++); ! if (bindings.__finditem__(key) == null) { ! int dataType = column.__getitem__(DATA_TYPE).__int__().getValue(); ! String name = column.__getitem__(NAME).toString(); ! ! bindings.__setitem__(key, Py.newInteger(dataType)); ! } ! ! // inputs are JDBC-indexed ! this.inputSet.set(i + 1); break; } } ! } ! /** ! * This method determines whether the param at the specified index is an ! * IN or INOUT param for a stored procedure. This is only configured properly ! * AFTER a call to normalizeInput(). ! * ! * @param index JDBC indexed column index (1, 2, ...) ! * ! * @return true if the column is an input, false otherwise ! * ! * @throws SQLException ! * ! */ ! public boolean isInput(int index) throws SQLException { ! return this.inputSet.get(index); } *************** *** 165,179 **** * As of now, all parameters variables are created and no support for named variable * calling is supported. * @return String * */ ! protected String buildSql() throws SQLException { int colParam = 0; int colReturn = 0; ! if (columns != Py.None) { ! for (int i = 0, len = columns.__len__(); i < len; i++) { ! PyObject column = columns.__getitem__(i); int colType = column.__getitem__(COLUMN_TYPE).__int__().getValue(); --- 202,217 ---- * As of now, all parameters variables are created and no support for named variable * calling is supported. + * * @return String * */ ! public String toSql() throws SQLException { int colParam = 0; int colReturn = 0; ! if (this.columns != Py.None) { ! for (int i = 0, len = this.columns.__len__(); i < len; i++) { ! PyObject column = this.columns.__getitem__(i); int colType = column.__getitem__(COLUMN_TYPE).__int__().getValue(); *************** *** 215,218 **** --- 253,258 ---- } + String name = cursor.datahandler.getProcedureName(procedureCatalog, procedureSchema, procedureName); + sql.append("call ").append(name).append("("); *************** *** 231,235 **** /** ! * Method registerOutParameters * * @param CallableStatement statement --- 271,275 ---- /** ! * Registers the OUT/INOUT parameters of the statement. * * @param CallableStatement statement *************** *** 240,251 **** protected void registerOutParameters(CallableStatement statement) throws SQLException { ! if (columns == Py.None) { return; } ! for (int i = 0, len = columns.__len__(); i < len; i++) { ! PyObject column = columns.__getitem__(i); int colType = column.__getitem__(COLUMN_TYPE).__int__().getValue(); int dataType = column.__getitem__(DATA_TYPE).__int__().getValue(); switch (colType) { --- 280,292 ---- protected void registerOutParameters(CallableStatement statement) throws SQLException { ! if (this.columns == Py.None) { return; } ! for (int i = 0, len = this.columns.__len__(); i < len; i++) { ! PyObject column = this.columns.__getitem__(i); int colType = column.__getitem__(COLUMN_TYPE).__int__().getValue(); int dataType = column.__getitem__(DATA_TYPE).__int__().getValue(); + String dataTypeName = column.__getitem__(DATA_TYPE_NAME).toString(); switch (colType) { *************** *** 254,258 **** case DatabaseMetaData.procedureColumnOut : case DatabaseMetaData.procedureColumnReturn : ! cursor.datahandler.registerOut(statement, i + 1, colType, dataType); break; } --- 295,299 ---- case DatabaseMetaData.procedureColumnOut : case DatabaseMetaData.procedureColumnReturn : ! cursor.datahandler.registerOut(statement, i + 1, colType, dataType, dataTypeName); break; } *************** *** 273,277 **** pec.datahandler = this.cursor.datahandler; ! pec.procedurecolumns(Py.newString(""), Py.newString(""), name, Py.None); this.columns = pec.fetchall(); --- 314,318 ---- pec.datahandler = this.cursor.datahandler; ! pec.procedurecolumns(procedureCatalog, procedureSchema, procedureName, Py.None); this.columns = pec.fetchall(); Index: PyCursor.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/PyCursor.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PyCursor.java 2001/12/17 03:44:42 1.10 --- PyCursor.java 2001/12/29 07:16:20 1.11 *************** *** 206,210 **** dict.__setitem__("setinputsizes", new CursorFunc("setinputsizes", 6, 1, "not implemented")); dict.__setitem__("setoutputsize", new CursorFunc("setoutputsize", 7, 1, 2, "not implemented")); ! dict.__setitem__("callproc", new CursorFunc("callproc", 8, 1, 2, "executes a stored procedure")); dict.__setitem__("executemany", new CursorFunc("executemany", 9, 1, 3, "execute sql with the parameter list")); --- 206,210 ---- dict.__setitem__("setinputsizes", new CursorFunc("setinputsizes", 6, 1, "not implemented")); dict.__setitem__("setoutputsize", new CursorFunc("setoutputsize", 7, 1, 2, "not implemented")); ! dict.__setitem__("callproc", new CursorFunc("callproc", 8, 1, 4, "executes a stored procedure")); dict.__setitem__("executemany", new CursorFunc("executemany", 9, 1, 3, "execute sql with the parameter list")); *************** *** 318,322 **** * through the standard fetchXXX() methods. */ ! public void callproc(PyObject name, PyObject params, PyObject bindings, PyObject maxRows) { clear(); --- 318,322 ---- * through the standard fetchXXX() methods. */ ! public void callproc(PyObject name, final PyObject params, PyObject bindings, PyObject maxRows) { clear(); *************** *** 329,332 **** --- 329,333 ---- final Procedure procedure = new Procedure(this, name); + PyDictionary callableBindings = new PyDictionary(); this.sqlStatement = procedure.prepareCall(); *************** *** 336,342 **** } ! params = procedure.normalizeParams(params); ! prepare(params, bindings); execute(new ExecuteSQL() { --- 337,352 ---- } ! // get the bindings per the stored proc spec ! procedure.normalizeInput(params, callableBindings); ! // overwrite with any user specific bindings ! if (bindings instanceof PyDictionary) { ! callableBindings.update((PyDictionary)bindings); ! } ! ! // prepare the statement ! prepare(params, callableBindings, procedure); ! ! // call the procedure execute(new ExecuteSQL() { *************** *** 345,350 **** final CallableStatement callableStatement = (CallableStatement)sqlStatement; ! callableStatement.execute(); ! fetch.add(callableStatement, procedure); } }); --- 355,363 ---- final CallableStatement callableStatement = (CallableStatement)sqlStatement; ! if (callableStatement.execute()) { ! fetch.add(callableStatement.getResultSet()); ! } ! ! fetch.add(callableStatement, procedure, params); } }); *************** *** 431,439 **** PyObject param = params.__getitem__(i); ! prepare(param, bindings); execute(esql); } } else { ! prepare(params, bindings); execute(esql); } --- 444,452 ---- PyObject param = params.__getitem__(i); ! prepare(param, bindings, null); execute(esql); } } else { ! prepare(params, bindings, null); execute(esql); } *************** *** 459,463 **** /** ! * Performs the execution * * @param ExecuteSQL execute --- 472,477 ---- /** ! * Execute the current sql statement. Some generic functionality such ! * as updating the rowid and updatecount occur as well. * * @param ExecuteSQL execute *************** *** 485,493 **** * @param PyObject params a non-None seq of sequences or entities * @param PyObject bindings an optional dictionary of index:DBApiType mappings * * @throws SQLException * */ ! protected void prepare(PyObject params, PyObject bindings) throws SQLException { if (params == Py.None) { --- 499,508 ---- * @param PyObject params a non-None seq of sequences or entities * @param PyObject bindings an optional dictionary of index:DBApiType mappings + * @param Procedure procedure * * @throws SQLException * */ ! protected void prepare(PyObject params, final PyObject bindings, final Procedure procedure) throws SQLException { if (params == Py.None) { *************** *** 497,530 **** // [3, 4] or (3, 4) final PreparedStatement preparedStatement = (PreparedStatement)this.sqlStatement; ! // clear the statement so all new bindings take affect ! preparedStatement.clearParameters(); ! for (int i = 0, len = params.__len__(); i < len; i++) { ! PyObject param = params.__getitem__(i); ! if (param == Procedure.PLACEHOLDER) { continue; } if (bindings != Py.None) { ! PyObject binding = bindings.__finditem__(Py.newInteger(i)); if (binding != null) { - int bindingValue = 0; - try { ! bindingValue = binding.__int__().getValue(); } catch (PyException e) { throw zxJDBC.makeException(zxJDBC.ProgrammingError, zxJDBC.getString("bindingValue")); } - this.datahandler.setJDBCObject(preparedStatement, i + 1, param, bindingValue); - continue; } } ! this.datahandler.setJDBCObject(preparedStatement, i + 1, param); } --- 512,556 ---- // [3, 4] or (3, 4) final PreparedStatement preparedStatement = (PreparedStatement)this.sqlStatement; + int columns = 0, column = 0, index = params.__len__(); ! if (procedure == null) { ! columns = params.__len__(); ! // clear the statement so all new bindings take affect only if not a callproc ! // this is because Procedure already registered the OUT parameters and we ! // don't want to lose those ! preparedStatement.clearParameters(); ! } else { ! columns = (procedure.columns == Py.None) ? 0 : procedure.columns.__len__(); ! } ! // count backwards through all the columns ! while (columns-- > 0) { ! column = columns + 1; ! ! if ((procedure != null) && (!procedure.isInput(column))) { continue; } + // working from right to left + PyObject param = params.__getitem__(--index); + if (bindings != Py.None) { ! PyObject binding = bindings.__finditem__(Py.newInteger(index)); if (binding != null) { try { ! int bindingValue = binding.__int__().getValue(); ! ! this.datahandler.setJDBCObject(preparedStatement, column, param, bindingValue); } catch (PyException e) { throw zxJDBC.makeException(zxJDBC.ProgrammingError, zxJDBC.getString("bindingValue")); } continue; } } ! this.datahandler.setJDBCObject(preparedStatement, column, param); } |
From: brian z. <bz...@us...> - 2001-12-29 07:16:23
|
Update of /cvsroot/jython/jython/com/ziclix/python/sql/handler In directory usw-pr-cvs1:/tmp/cvs-serv2506/ziclix/python/sql/handler Modified Files: OracleDataHandler.java Added Files: SQLServerDataHandler.java Log Message: stored procedure changes --- NEW FILE: SQLServerDataHandler.java --- /* * Jython Database Specification API 2.0 * * $Id: SQLServerDataHandler.java,v 1.1 2001/12/29 07:16:20 bzimmer Exp $ * * Copyright (c) 2001 brian zimmer <bz...@zi...> * */ package com.ziclix.python.sql.handler; import java.io.*; import java.sql.*; import java.math.*; import org.python.core.*; import com.ziclix.python.sql.*; /** * SQLServer specific data handling. * * @author brian zimmer * @author last revised by $Author: bzimmer $ * @version $Revision: 1.1 $ */ public class SQLServerDataHandler extends FilterDataHandler { /** Field UNICODE_VARCHAR */ public static final int UNICODE_VARCHAR = -9; /** * Decorator for handling SQLServer specific issues. * * @param datahandler the delegate DataHandler */ public SQLServerDataHandler(DataHandler datahandler) { super(datahandler); } /** * Given a ResultSet, column and type, return the appropriate * Jython object. * * <p>Note: DO NOT iterate the ResultSet. * * @param set the current ResultSet set to the current row * @param col the column number (adjusted properly for JDBC) * @param type the column type * @throws SQLException if the type is unmappable */ public PyObject getPyObject(ResultSet set, int col, int type) throws SQLException { PyObject obj = Py.None; switch (type) { case UNICODE_VARCHAR : obj = super.getPyObject(set, col, Types.VARCHAR); break; default : obj = super.getPyObject(set, col, type); } return (set.wasNull() || (obj == null)) ? Py.None : obj; } /** * Method getProcedureName * * @param PyObject catalog * @param PyObject schema * @param PyObject name * * @return String * */ public String getProcedureName(PyObject catalog, PyObject schema, PyObject name) { StringBuffer procName = new StringBuffer(); if ((schema != Py.EmptyString) && (schema != Py.None)) { procName.append(schema.toString()).append("."); } return procName.append(name.toString()).toString(); } } Index: OracleDataHandler.java =================================================================== RCS file: /cvsroot/jython/jython/com/ziclix/python/sql/handler/OracleDataHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OracleDataHandler.java 2001/12/14 04:19:27 1.3 --- OracleDataHandler.java 2001/12/29 07:16:20 1.4 *************** *** 132,134 **** --- 132,164 ---- return (set.wasNull() ? Py.None : obj); } + + /** + * Called when a stored procedure or function is executed and OUT parameters + * need to be registered with the statement. + * + * @param CallableStatement statement + * @param int index the JDBC offset column number + * @param int colType the column as from DatabaseMetaData (eg, procedureColumnOut) + * @param int dataType the JDBC datatype from Types + * @param String dataTypeName the JDBC datatype name + * + * @throws SQLException + * + */ + public void registerOut(CallableStatement statement, int index, int colType, int dataType, String dataTypeName) throws SQLException { + + if (dataType == Types.OTHER) { + if ("REF CURSOR".equals(dataTypeName)) { + statement.registerOutParameter(index, OracleTypes.CURSOR); + + return; + } else if ("PL/SQL RECORD".equals(dataTypeName)) { + statement.registerOutParameter(index, OracleTypes.CURSOR); + + return; + } + } + + super.registerOut(statement, index, colType, dataType, dataTypeName); + } } |
From: Finn B. <bc...@us...> - 2001-12-27 15:34:04
|
Update of /cvsroot/jython/jython In directory usw-pr-cvs1:/tmp/cvs-serv11644 Modified Files: Makefile Log Message: Added Lib/jxxload_help to SUBDIRS. Fix for bug "[ #490965 ] Please add Makefiles to subdirectories". Index: Makefile =================================================================== RCS file: /cvsroot/jython/jython/Makefile,v retrieving revision 2.0 retrieving revision 2.1 diff -C2 -d -r2.0 -r2.1 *** Makefile 2000/10/16 18:39:06 2.0 --- Makefile 2001/12/27 15:34:01 2.1 *************** *** 15,19 **** org/python/modules \ org/python/util \ ! org/python/rmi CLEANDIRS = $(SUBDIRS) \ --- 15,20 ---- org/python/modules \ org/python/util \ ! org/python/rmi \ ! Lib/jxxload_help CLEANDIRS = $(SUBDIRS) \ |
From: Finn B. <bc...@us...> - 2001-12-27 15:31:02
|
Update of /cvsroot/jython/jython/Lib/jxxload_help In directory usw-pr-cvs1:/tmp/cvs-serv10477 Added Files: Makefile Log Message: Adding a makefile for compiling java sources. Fix for bug "[ #490965 ] Please add Makefiles to subdirectories". --- NEW FILE: Makefile --- include ../../Misc/make.rules CLASSPATH = ../..:.. |
From: Finn B. <bc...@us...> - 2001-12-27 15:21:03
|
Update of /cvsroot/jython/jython/org/python/modules In directory usw-pr-cvs1:/tmp/cvs-serv6082 Modified Files: imp.java Log Message: Moved the sys.path default value into the 2 arg version of find_module to support an explicit None argument. Fix for bug "[ #495604 ] imp.find_module fails when None is 2 arg". Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/imp.java,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** imp.java 2001/03/13 20:27:30 2.5 --- imp.java 2001/12/27 15:21:00 2.6 *************** *** 24,32 **** public static PyObject find_module(String name) { ! return find_module(name, Py.getSystemState().__getattr__("path")); } public static PyObject find_module(String name, PyObject path) { PyObject p = null; for (int i = 0; (p = path.__finditem__(i)) != null; i++) { --- 24,34 ---- public static PyObject find_module(String name) { ! return find_module(name, null); } public static PyObject find_module(String name, PyObject path) { + if (path == null || path == Py.None) + path = Py.getSystemState().__getattr__("path"); PyObject p = null; for (int i = 0; (p = path.__finditem__(i)) != null; i++) { |