Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5997825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:19:08+00:00 2026-05-23T00:19:08+00:00

I am using JDBC to connect my jython to a heterogeneous set of databases.

  • 0

I am using JDBC to connect my jython to a heterogeneous set of databases.
Using a cursor I get the rows in list form, and the cursor
also knows the metadata (cursor.description).

Usually you get a row as list as result of a query:

print resultlist(4)

And you have to know the order of the Columns in the schema beforehand.

How can I get something like

print resultset[CustomerName]

to print the name of a customer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:19:09+00:00Added an answer on May 23, 2026 at 12:19 am

    How about dict_cursor from this question: Django Backend-neutral DictCursor?

    Outline of what works for me (Jython 2.5.2):

    def dict_cursor(cursor):
        description = [x[0] for x in cursor.description]
        for row in cursor:
            yield dict(zip(description, row))
    
    conn = zxJDBC.connect(db, user, pwd, driver)
    cursor = conn.cursor()
    
    query = "..."
    cursor.execute(query)
    
    dc = dict_cursor(cursor)
    for d in dc:
        print d["SomeColumnName"]
        ...
    
    cursor.close()
    conn.close()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using JDBC to connect to my microsoft access database. I get the
I am using jdbc to connect to a postgresql database in a java application
I am using JDBC to connect to MySQL for a small application. In order
I am using JDBC with proxool connection pool to connect to mysql DB. I
I'm trying to connect to a SQL Server database using JDBC, the database I'm
Can we connect to a dBAse/FoxPro .dbf file on Linux using JDBC?
I am trying to retrieve data form an Oracle database using jdbc (ojdbc14.jar). I
We are currently using Spring JDBC with connection pool implementation from DBCP to connect
I am using JDBC to connect to a database server. The connection is over
I am trying to connect the Sql Server 2008 R2 with java using JDBC.I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.