Re: inet datatype question!

Lists: pgsql-jdbc
From: <m(dot)bakirov(at)transfer(dot)kg>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: inet datatype question!
Date: 2002-05-20 10:41:11
Message-ID: 38161.195.151.26.4.1021891271.squirrel@webmail.transfer.kg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi all!

Can you help me with the following problem?

I have created a table:

CREATE TABLE(
src inet,
dst inet,
size int);

How can I insert an ip address or a network address into src or dst within
a Java program, using a Postgresql JDBC driver? - Which method to use? -->
setXxx?
Thank you very much!


From: Dave Cramer <Dave(at)micro-automation(dot)net>
To: m(dot)bakirov(at)transfer(dot)kg
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: inet datatype question!
Date: 2002-05-20 12:11:58
Message-ID: 1021896719.16927.15.camel@inspiron.cramers
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi,

Unfortunately java doesn't have a "type" that corresponds to the
postgres inet type. You can retrieve it as a string however. Use
getString. Of course you will have to parse the string.

Dave
On Mon, 2002-05-20 at 06:41, m(dot)bakirov(at)transfer(dot)kg wrote:
> Hi all!
>
> Can you help me with the following problem?
>
> I have created a table:
>
> CREATE TABLE(
> src inet,
> dst inet,
> size int);
>
> How can I insert an ip address or a network address into src or dst within
> a Java program, using a Postgresql JDBC driver? - Which method to use? -->
> setXxx?
> Thank you very much!
>
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>


From: Michael Adler <adler(at)glimpser(dot)org>
To: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: SocketException: "catch me if you can"
Date: 2002-05-20 19:03:51
Message-ID: Pine.NEB.4.44.0205201426070.9963-100000@reva.sixgirls.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc


I am using a JDBC connection over a PPP connection layer. The pgsql-jdbc
driver throws a SocketException and the databse connection dies. I
consider the ppp layer to be "suspect", but at least it survives this
hiccup. Is it (1) possible (2) a good idea to beef up the driver to handle
this situation? Or should my application logic handle this?

BTW- I'm using the cygwin port of postgresql and therefore I'm using
microsft's dialup software ('rasdial', blech)

Thanks,
Mike Adler

======================================

An I/O error occured while reading from backend - Exception:
java.net.SocketException: Connection reset by peer: JVM_recv in socket
input stream read

Stack Trace:

java.net.SocketException: Connection reset by peer: JVM_recv in socket
input stream read
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at org.postgresql.PG_Stream.ReceiveChar(PG_Stream.java:141)
at
org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:68)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
at
org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java:113)
at com.ics.eagle.other.RemoteSync.main(RemoteSync.java:324)
End of Stack Trace

at org.postgresql.PG_Stream.ReceiveChar(PG_Stream.java:147)
at
org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:68)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
at
org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java:113)
at com.ics.eagle.other.RemoteSync.main(RemoteSync.java:324)


From: <m(dot)bakirov(at)transfer(dot)kg>
To: <Dave(at)micro-automation(dot)net>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: inet datatype question!
Date: 2002-05-21 03:42:57
Message-ID: 39424.195.151.26.4.1021952577.squirrel@webmail.transfer.kg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Thank you very much for a reply! If for retrieve I use getString, what
should I use for inserting an inet datatype?
Rgrds...

> Hi,
>
> Unfortunately java doesn't have a "type" that corresponds to the
> postgres inet type. You can retrieve it as a string however. Use
> getString. Of course you will have to parse the string.
>
> Dave
> On Mon, 2002-05-20 at 06:41, m(dot)bakirov(at)transfer(dot)kg wrote:
>> Hi all!
>>
>> Can you help me with the following problem?
>>
>> I have created a table:
>>
>> CREATE TABLE(
>> src inet,
>> dst inet,
>> size int);
>>
>> How can I insert an ip address or a network address into src or dst
>> within a Java program, using a Postgresql JDBC driver? - Which method
>> to use? --> setXxx?
>> Thank you very much!
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------(end of
>> broadcast)--------------------------- TIP 5: Have you checked our
>> extensive FAQ?
>>
>> http://www.postgresql.org/users-lounge/docs/faq.html
>>
>>
>
>
>
>
> ---------------------------(end of
> broadcast)--------------------------- TIP 6: Have you searched our list
> archives?
>
> http://archives.postgresql.org