vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Upgrading to the latest 8.3 JDBC driver broke one of our queries (that we have found) that involves arrays in the database. Reverting to the latest 8.2 driver fixes it. The table is: Table "public.cpe_health" Column | Type | Modifiers --------------+------------+------------------------------------------------ ------------------- cpe_healthid | integer | not null default nextval('cpe_health_cpe_healthid_seq'::regclass) mac | macaddr | polldate | integer | health | smallint | data | integer[] | alarm | smallint[] | My query is: SELECT mac, CASE health WHEN 0 THEN 'red' WHEN 1 THEN 'yellow' WHEN 3 THEN 'green' ELSE 'blue' END AS health, array_upper(data,1) AS datasize, data, alarm FROM cpe_health; The exception I get is: java.lang.ClassCastException: [Ljava.lang.Integer; at net.iglass.jglass.cpe.dao.CpeDataDAO$14.handle(Cpe DataDAO.java:1018) at net.iglass.db.QueryRunner.query(QueryRunner.java:3 15) at net.iglass.db.QueryRunner.query(QueryRunner.java:3 36) at net.iglass.jglass.cpe.dao.CpeDataDAO.getHealthData (CpeDataDAO.java:1042) Which line 1018 in my code is: int[] hdata = (int[])(rs.getArray("data")).getArray(); Any advice on how to properly fetch the array data in my code would be appreciated. Thanks Woody ---------------------------------------- iGLASS Networks 3300 Green Level Rd. West Cary NC 27519 (919) 387-3550 x813 www.iglass.net -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc |
| Thread Tools | |
| Display Modes | |
| |