Message5080
Hello, I use Jython2.5.0, mysql-connector-java-5.0.8-bin.jar, because my
sever is Mysql5.0.38 There is a problem in my Jython application.OS:ubuntu
Two functions:
def act_query(query):
connection = conn //conn is global and has been assigned when called
cursor = connection.cursor()
num_affected_rows = cursor.execute(query)
cursor.close()
connection.commit()
return num_affected_rows
def get_row(query):
connection = conn
cursor = connection.cursor()
cursor.execute(query)
row = cursor.fetchone()
cursor.close()
return row
Then i do something like this:
query = """SELECT 15 into @max"""
act_query(query)
get_query= """ select @max """
row = get_row(get_query)
print row
The output is something like: array('b', [49, 52])
I try to find the reason and make a test like:
test_query = """select @max = 15"""
row = get_row(test_query)
print row
The output is the right answer |
|
Date |
User |
Action |
Args |
2009-09-01 03:49:35 | kezhifeng | set | recipients:
+ kezhifeng |
2009-09-01 03:49:35 | kezhifeng | set | messageid: <1251776975.53.0.0627588579864.issue1451@psf.upfronthosting.co.za> |
2009-09-01 03:49:35 | kezhifeng | link | issue1451 messages |
2009-09-01 03:49:34 | kezhifeng | create | |
|