Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
80c98002
Commit
80c98002
authored
22 years ago
by
Barry Lind
Browse files
Options
Downloads
Patches
Plain Diff
Update jdbc doc to reflect correct name of the PGConnection class.
parent
5ec61f4d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/jdbc.sgml
+15
-21
15 additions, 21 deletions
doc/src/sgml/jdbc.sgml
with
15 additions
and
21 deletions
doc/src/sgml/jdbc.sgml
+
15
−
21
View file @
80c98002
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.
39
2002/1
0/01 04:09:13
barry Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.
40
2002/1
1/11 07:31:28
barry Exp $
-->
-->
<chapter id="jdbc">
<chapter id="jdbc">
...
@@ -684,7 +684,7 @@ CREATE TABLE imagesLO (imgname text, imgOID OID);
...
@@ -684,7 +684,7 @@ CREATE TABLE imagesLO (imgname text, imgOID OID);
conn.setAutoCommit(false);
conn.setAutoCommit(false);
// Get the Large Object Manager to perform operations with
// Get the Large Object Manager to perform operations with
LargeObjectManager lobj = ((org.postgresql.Connection)conn).getLargeObjectAPI();
LargeObjectManager lobj = ((org.postgresql.
PG
Connection)conn).getLargeObjectAPI();
//create a new large object
//create a new large object
int oid = lobj.create(LargeObjectManager.READ | LargeObjectManager.WRITE);
int oid = lobj.create(LargeObjectManager.READ | LargeObjectManager.WRITE);
...
@@ -725,7 +725,7 @@ fis.close();
...
@@ -725,7 +725,7 @@ fis.close();
conn.setAutoCommit(false);
conn.setAutoCommit(false);
// Get the Large Object Manager to perform operations with
// Get the Large Object Manager to perform operations with
LargeObjectManager lobj = ((org.postgresql.Connection)conn).getLargeObjectAPI();
LargeObjectManager lobj = ((org.postgresql.
PG
Connection)conn).getLargeObjectAPI();
PreparedStatement ps = con.prepareStatement("SELECT imgOID FROM imagesLO WHERE imgname=?");
PreparedStatement ps = con.prepareStatement("SELECT imgOID FROM imagesLO WHERE imgname=?");
ps.setString(1, "myimage.gif");
ps.setString(1, "myimage.gif");
...
@@ -774,33 +774,27 @@ ps.close();
...
@@ -774,33 +774,27 @@ ps.close();
<para>
<para>
To access some of the extensions, you need to use some extra
To access some of the extensions, you need to use some extra
methods in the <classname>org.postgresql.Connection</classname>
methods in the <classname>org.postgresql.
PG
Connection</classname>
class. In this case, you would need to case the return value of
class. In this case, you would need to case the return value of
<function>Driver.getConnection()</function>. For example:
<function>Driver.getConnection()</function>. For example:
<programlisting>
<programlisting>
Connection db = Driver.getConnection(url, username, password);
Connection db = Driver.getConnection(url, username, password);
// ...
// ...
// later on
// later on
Fastpath fp = ((org.postgresql.Connection)db).getFastpathAPI();
Fastpath fp = ((org.postgresql.
PG
Connection)db).getFastpathAPI();
</programlisting>
</programlisting>
</para>
</para>
<sect3>
<sect3>
<title>Class <classname>org.postgresql.Connection</classname></title>
<title>Class <classname>org.postgresql.
PG
Connection</classname></title>
<synopsis>
<synopsis>
public class Connection extends Object implements Connection
public class PGConnection
java.lang.Object
|
+----org.postgresql.Connection
</synopsis>
</synopsis>
<para>
<para>
These are the extra methods used to gain access to
These are the extra methods used to gain access to
<productname>PostgreSQL</productname>'s extensions. Methods
<productname>PostgreSQL</productname>'s extensions.
defined by <classname>java.sql.Connection</classname> are not
listed.
</para>
</para>
<sect4>
<sect4>
...
@@ -822,7 +816,7 @@ public Fastpath getFastpathAPI() throws SQLException
...
@@ -822,7 +816,7 @@ public Fastpath getFastpathAPI() throws SQLException
<programlisting>
<programlisting>
import org.postgresql.fastpath.*;
import org.postgresql.fastpath.*;
...
...
Fastpath fp = ((org.postgresql.Connection)myconn).getFastpathAPI();
Fastpath fp = ((org.postgresql.
PG
Connection)myconn).getFastpathAPI();
</programlisting>
</programlisting>
where <varname>myconn</> is an open <classname>Connection</> to <productname>PostgreSQL</productname>.
where <varname>myconn</> is an open <classname>Connection</> to <productname>PostgreSQL</productname>.
</para>
</para>
...
@@ -857,7 +851,7 @@ public LargeObjectManager getLargeObjectAPI() throws SQLException
...
@@ -857,7 +851,7 @@ public LargeObjectManager getLargeObjectAPI() throws SQLException
<programlisting>
<programlisting>
import org.postgresql.largeobject.*;
import org.postgresql.largeobject.*;
...
...
LargeObjectManager lo = ((org.postgresql.Connection)myconn).getLargeObjectAPI();
LargeObjectManager lo = ((org.postgresql.
PG
Connection)myconn).getLargeObjectAPI();
</programlisting>
</programlisting>
where <varname>myconn</> is an open <classname>Connection</> to
where <varname>myconn</> is an open <classname>Connection</> to
<productname>PostgreSQL</productname>.
<productname>PostgreSQL</productname>.
...
@@ -896,7 +890,7 @@ public void addDataType(String type, String name)
...
@@ -896,7 +890,7 @@ public void addDataType(String type, String name)
The best way to use this is as follows:
The best way to use this is as follows:
<programlisting>
<programlisting>
...
...
((org.postgresql.Connection)myconn).addDataType("mytype","my.class.name");
((org.postgresql.
PG
Connection)myconn).addDataType("mytype","my.class.name");
...
...
</programlisting>
</programlisting>
where <varname>myconn</varname> is an open <classname>Connection</> to
where <varname>myconn</varname> is an open <classname>Connection</> to
...
@@ -938,12 +932,12 @@ import org.postgresql.fastpath.*;
...
@@ -938,12 +932,12 @@ import org.postgresql.fastpath.*;
Then, in your code, you need to get a
Then, in your code, you need to get a
<classname>FastPath</classname> object:
<classname>FastPath</classname> object:
<programlisting>
<programlisting>
Fastpath fp = ((org.postgresql.Connection)conn).getFastpathAPI();
Fastpath fp = ((org.postgresql.
PG
Connection)conn).getFastpathAPI();
</programlisting>
</programlisting>
This will return an instance associated with the database
This will return an instance associated with the database
connection that you can use to issue commands. The casing of
connection that you can use to issue commands. The casing of
<classname>Connection</classname> to
<classname>Connection</classname> to
<classname>org.postgresql.Connection</classname> is required, as
<classname>org.postgresql.
PG
Connection</classname> is required, as
the <function>getFastpathAPI()</function> is an extension method,
the <function>getFastpathAPI()</function> is an extension method,
not part of <acronym>JDBC</acronym>. Once you have a
not part of <acronym>JDBC</acronym>. Once you have a
<classname>Fastpath</classname> instance, you can use the
<classname>Fastpath</classname> instance, you can use the
...
@@ -2322,14 +2316,14 @@ java.lang.Object
...
@@ -2322,14 +2316,14 @@ java.lang.Object
</para>
</para>
<para>
<para>
This class can only be created by org.postgresql.Connection. To
This class can only be created by org.postgresql.
PG
Connection. To
get access to this class, use the following segment of code:
get access to this class, use the following segment of code:
<programlisting>
<programlisting>
import org.postgresql.largeobject.*;
import org.postgresql.largeobject.*;
Connection conn;
Connection conn;
LargeObjectManager lobj;
LargeObjectManager lobj;
// ... code that opens a connection ...
// ... code that opens a connection ...
lobj = ((org.postgresql.Connection)myconn).getLargeObjectAPI();
lobj = ((org.postgresql.
PG
Connection)myconn).getLargeObjectAPI();
</programlisting>
</programlisting>
</para>
</para>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment