using zxJDBC for Queries with NUMBER datatype in Oracle

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown using zxJDBC for Queries with NUMBER datatype in Oracle

by Jones, Steven-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

When I run Oracle queries using zxJDBC, the results for the Oracle datatype ‘NUMBER’ always have a decimal place added (e.g. 12345.0 instead of just 12345).  If I run the query using SQLPlus for example, the results returned are integers as expected.

 

Here is the query in Jython:

 

>> from com.ziclix.python.sql import zxJDBC

>> db = zxJDBC.connect('jdbc:oracle:thin:@host:port:db','system','xxxx','oracle.jdbc.OracleDriver')

>> a = db.cursor()

>> a.execute('select part_uid,product_id from mytable.dp_history')

>> a.fetchone()

(4209580.0, u'ARCH')

 

 

The same result in SQL*Plus returns:

4209580, ARCH

 

 

Is there a way to configure the data types in zxJDBC?

 

My classpath:  /home/jython/ojdbc6.jar

 

My Java version:

 

$ java -version

java version "1.6.0_03"

Java(TM) SE Runtime Environment (build 1.6.0_03-b05)

Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)

 

 

This issue can be replicated in any version of Jython.

 

 

Thanks,

Steve


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users