File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Java Datatype mapping with psotgres cidr type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Java Datatype mapping with psotgres cidr type" Watch "Java Datatype mapping with psotgres cidr type" New topic
Author

Java Datatype mapping with psotgres cidr type

saakshi joshi
Greenhorn

Joined: Aug 20, 2009
Posts: 3
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30516
    
150

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?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Datatype mapping with psotgres cidr type