I've been programming in jython using a certain driver and to access a certain position in a query I just use .getString(3)
So if I'm querying three things like name, address, phone number its very easy to:
name = myqueryresults.getString(1)
but now I'm using a cursor and the zxJDBC driver in eclipse and I absolutely can not figure out how to get this same functionality.
Say I want:
myquery.execute(Select name, address, phone number from blahblah)
name = "what the crap goes here!?"
Thanks!
-Will
alright lost my mind. !! :) Just want specific column in row ahhhh
Started by williamevanl, Mar 31 2011 10:50 AM
2 replies to this topic
#1
Posted 31 March 2011 - 10:50 AM
|
|
|
#2
Posted 31 March 2011 - 12:32 PM
How about:
PyCursor (Jython API documentation))
Quote
__findattr__
public PyObject __findattr__(java.lang.String name)
Gets the value of the attribute name.
Overrides:
__findattr__ in class PyObject
Parameters:
name -
Returns:
the attribute for the given name
See Also:
PyObject.__findattr__(PyString)
public PyObject __findattr__(java.lang.String name)
Gets the value of the attribute name.
Overrides:
__findattr__ in class PyObject
Parameters:
name -
Returns:
the attribute for the given name
See Also:
PyObject.__findattr__(PyString)
#3
Posted 31 March 2011 - 12:35 PM
pfth, just figured it out, simply myquery.fetchone()[2]
that [2] is what I was looking for...
that [2] is what I was looking for...
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









