• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Datatype mapping with psotgres cidr type

 
saakshi joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to get the range of ipadresses stored postgres table with column type cidr .
But I am getting an exception when trying to insert any row through my javacode whenever I pass ipaddress value as String
ERROR: column "ipaddress" is of type cidr but expression is of type character varying

So does anyone know which JavaType is mapped with postgres cidr datatype?

Or is there any other way to find ipaddress range using Java and storing ipaddress as varchar in postgres table?

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34202
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like it should be String. Can you show the code that throws the error.? Are you using the JDBC driver that came with the database?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic