Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit35d70e9

Browse files
author
Peter Mount
committed
Replaced <literal></literal> with "" in ProgramListing sections
1 parent0c0151a commit35d70e9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎doc/src/sgml/jdbc.sgml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ In the first method, your code implicitly loads the driver using the
163163
Class.forName() method. For <application>Postgres</application>, you would use:
164164

165165
<programlisting>
166-
Class.forName(<literal>postgresql.Driver</literal>);
166+
Class.forName("postgresql.Driver");
167167
</programlisting>
168168

169169
This will load the driver, and while loading, the driver will automatically
@@ -380,9 +380,9 @@ An example is as follows:
380380

381381
<programlisting>
382382
Statement st = db.createStatement();
383-
ResultSet rs = st.executeQuery(<literal>select * from mytable</literal>);
383+
ResultSet rs = st.executeQuery("select * from mytable");
384384
while(rs.next()) {
385-
System.out.print(<literal>Column 1 returned</literal>);
385+
System.out.print("Column 1 returned");
386386
System.out.println(rs.getString(1));
387387
}
388388
rs.close();
@@ -400,7 +400,7 @@ To perform an update (or any other SQL statement that does not return a
400400
result), you simply use the executeUpdate() method:
401401

402402
<programlisting>
403-
st.executeUpdate(<literal>create table basic (a int2, b int2)</literal>);
403+
st.executeUpdate("create table basic (a int2, b int2)");
404404
</programlisting>
405405
</para>
406406
</sect1>
@@ -455,9 +455,9 @@ create table images (imgname name,imgoid oid);
455455
To insert an image, you would use:
456456

457457
<programlisting>
458-
File file = new File(<literal>myimage.gif</literal>);
458+
File file = new File("myimage.gif");
459459
FileInputStream fis = new FileInputStream(file);
460-
PreparedStatement ps = conn.prepareStatement(<literal>insert into images values (?,?)</literal>);
460+
PreparedStatement ps = conn.prepareStatement("insert into images values (?,?)");
461461
ps.setString(1,file.getName());
462462
ps.setBinaryStream(2,fis,file.length());
463463
ps.executeUpdate();
@@ -477,8 +477,8 @@ Retrieving an image is even easier (I'm using PreparedStatement here, but
477477
Statement can equally be used):
478478

479479
<programlisting>
480-
PreparedStatement ps = con.prepareStatement(<literal>select oid from images where name=?</literal>);
481-
ps.setString(1,<literal>myimage.gif</literal>);
480+
PreparedStatement ps = con.prepareStatement("select oid from images where name=?");
481+
ps.setString(1,"myimage.gif");
482482
ResultSet rs = ps.executeQuery();
483483
if(rs!=null) {
484484
while(rs.next()) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp