Message5099

Author kezhifeng
Recipients kezhifeng, pjenvey
Date 2009-09-04.09:14:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1431204133.341.1252055671413.JavaMail.root@mail-1.space.163.org>
In-reply-to
Content
Thanks very much for your help!
I use JDBC directly and convert the resultset into a dict with ResultsetMetadata, so I can get the value by a column name, which is not supported by zxJDBC but MySQLdb. Maybe it can be supported by Jython3.0.
Best wishes!

------------------
kezhifeng
2009-9-4

-----------------------------------------------------------------------------------------
发件人:  Philip Jenvey <report@bugs.jython.org>
发送时间:  2009-09-04 10:25
主  题:  [issue1451] zxJDBC, cursor.fetchone() for a session variable ,
	I get an array .
收件人:  kezhifeng08

Philip Jenvey <pjenvey@users.sourceforge.net> added the comment:

This is pretty much expected when using JDBC as MySQL treats variables 
as VARBINARY, which most JDBC drivers (definitely MySQL's) return byte[] 
for, so we return the Python analog, an array.array of bytes. You can 
convert this to a string via bytes.tostring()

A byte array here is also currently more efficient than plain Python 
strings for Jython as our str is backed by java.lang.String instead of 
being a simple byte bucket like CPython's

When we change that (in Jython 3, or possibly before) we might want to 
consider changing this behavior, but probably not until then

----------
nosy: +pjenvey
resolution:  -> wont fix
status: open -> closed

_______________________________________
Jython tracker <report@bugs.jython.org>
<http://bugs.jython.org/issue1451>
_______________________________________
History
Date User Action Args
2009-09-04 09:14:36kezhifengsetrecipients: + kezhifeng, pjenvey
2009-09-04 09:14:36kezhifenglinkissue1451 messages
2009-09-04 09:14:35kezhifengcreate