import java.sql.*; public class InetTest { public static void main(String args[]) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5750/jurka","jurka",""); Statement stmt = conn.createStatement(); stmt.executeUpdate("CREATE TEMP TABLE tt (a inet)"); stmt.executeUpdate("INSERT INTO tt VALUES ('192.168.3.1')"); ResultSet rs = stmt.executeQuery("SELECT a FROM tt"); while (rs.next()) { System.out.println(rs.getString(1)); System.out.println(rs.getObject(1)); } rs.close(); stmt.close(); conn.close(); } }