11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.39 2002/10/01 04:09:13 barry Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.40 2002/11/11 07:31:28 barry Exp $
33-->
44
55 <chapter id="jdbc">
@@ -684,7 +684,7 @@ CREATE TABLE imagesLO (imgname text, imgOID OID);
684684conn.setAutoCommit(false);
685685
686686// Get the Large Object Manager to perform operations with
687- LargeObjectManager lobj = ((org.postgresql.Connection )conn).getLargeObjectAPI();
687+ LargeObjectManager lobj = ((org.postgresql.PGConnection )conn).getLargeObjectAPI();
688688
689689//create a new large object
690690int oid = lobj.create(LargeObjectManager.READ | LargeObjectManager.WRITE);
@@ -725,7 +725,7 @@ fis.close();
725725conn.setAutoCommit(false);
726726
727727// Get the Large Object Manager to perform operations with
728- LargeObjectManager lobj = ((org.postgresql.Connection )conn).getLargeObjectAPI();
728+ LargeObjectManager lobj = ((org.postgresql.PGConnection )conn).getLargeObjectAPI();
729729
730730PreparedStatement ps = con.prepareStatement("SELECT imgOID FROM imagesLO WHERE imgname=?");
731731ps.setString(1, "myimage.gif");
@@ -774,33 +774,27 @@ ps.close();
774774
775775 <para>
776776 To access some of the extensions, you need to use some extra
777- methods in the <classname>org.postgresql.Connection </classname>
777+ methods in the <classname>org.postgresql.PGConnection </classname>
778778 class. In this case, you would need to case the return value of
779779 <function>Driver.getConnection()</function>. For example:
780780<programlisting>
781781Connection db = Driver.getConnection(url, username, password);
782782// ...
783783// later on
784- Fastpath fp = ((org.postgresql.Connection )db).getFastpathAPI();
784+ Fastpath fp = ((org.postgresql.PGConnection )db).getFastpathAPI();
785785</programlisting>
786786 </para>
787787
788788 <sect3>
789- <title>Class <classname>org.postgresql.Connection </classname></title>
789+ <title>Class <classname>org.postgresql.PGConnection </classname></title>
790790
791791<synopsis>
792- public class Connection extends Object implements Connection
793-
794- java.lang.Object
795- |
796- +----org.postgresql.Connection
792+ public class PGConnection
797793</synopsis>
798794
799795 <para>
800796 These are the extra methods used to gain access to
801- <productname>PostgreSQL</productname>'s extensions. Methods
802- defined by <classname>java.sql.Connection</classname> are not
803- listed.
797+ <productname>PostgreSQL</productname>'s extensions.
804798 </para>
805799
806800 <sect4>
@@ -822,7 +816,7 @@ public Fastpath getFastpathAPI() throws SQLException
822816<programlisting>
823817import org.postgresql.fastpath.*;
824818...
825- Fastpath fp = ((org.postgresql.Connection )myconn).getFastpathAPI();
819+ Fastpath fp = ((org.postgresql.PGConnection )myconn).getFastpathAPI();
826820</programlisting>
827821 where <varname>myconn</> is an open <classname>Connection</> to <productname>PostgreSQL</productname>.
828822 </para>
@@ -857,7 +851,7 @@ public LargeObjectManager getLargeObjectAPI() throws SQLException
857851<programlisting>
858852import org.postgresql.largeobject.*;
859853...
860- LargeObjectManager lo = ((org.postgresql.Connection )myconn).getLargeObjectAPI();
854+ LargeObjectManager lo = ((org.postgresql.PGConnection )myconn).getLargeObjectAPI();
861855</programlisting>
862856 where <varname>myconn</> is an open <classname>Connection</> to
863857 <productname>PostgreSQL</productname>.
@@ -896,7 +890,7 @@ public void addDataType(String type, String name)
896890 The best way to use this is as follows:
897891<programlisting>
898892 ...
899- ((org.postgresql.Connection )myconn).addDataType("mytype","my.class.name");
893+ ((org.postgresql.PGConnection )myconn).addDataType("mytype","my.class.name");
900894 ...
901895</programlisting>
902896 where <varname>myconn</varname> is an open <classname>Connection</> to
@@ -938,12 +932,12 @@ import org.postgresql.fastpath.*;
938932 Then, in your code, you need to get a
939933 <classname>FastPath</classname> object:
940934<programlisting>
941- Fastpath fp = ((org.postgresql.Connection )conn).getFastpathAPI();
935+ Fastpath fp = ((org.postgresql.PGConnection )conn).getFastpathAPI();
942936</programlisting>
943937 This will return an instance associated with the database
944938 connection that you can use to issue commands. The casing of
945939 <classname>Connection</classname> to
946- <classname>org.postgresql.Connection </classname> is required, as
940+ <classname>org.postgresql.PGConnection </classname> is required, as
947941 the <function>getFastpathAPI()</function> is an extension method,
948942 not part of <acronym>JDBC</acronym>. Once you have a
949943 <classname>Fastpath</classname> instance, you can use the
@@ -2322,14 +2316,14 @@ java.lang.Object
23222316 </para>
23232317
23242318 <para>
2325- This class can only be created by org.postgresql.Connection . To
2319+ This class can only be created by org.postgresql.PGConnection . To
23262320 get access to this class, use the following segment of code:
23272321<programlisting>
23282322import org.postgresql.largeobject.*;
23292323Connection conn;
23302324LargeObjectManager lobj;
23312325// ... code that opens a connection ...
2332- lobj = ((org.postgresql.Connection )myconn).getLargeObjectAPI();
2326+ lobj = ((org.postgresql.PGConnection )myconn).getLargeObjectAPI();
23332327</programlisting>
23342328 </para>
23352329