Jump to content

alright lost my mind. !! :) Just want specific column in row ahhhh

- - - - -

  • Please log in to reply
2 replies to this topic

#1
williamevanl

williamevanl

    Learning Programmer

  • Members
  • PipPipPip
  • 61 posts
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

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
How about:

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)
PyCursor (Jython API documentation))

#3
williamevanl

williamevanl

    Learning Programmer

  • Members
  • PipPipPip
  • 61 posts
pfth, just figured it out, simply myquery.fetchone()[2]


that [2] is what I was looking for...




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users