Replaced with "" in ProgramListing sections
authorPeter Mount
Thu, 15 Apr 1999 06:00:16 +0000 (06:00 +0000)
committerPeter Mount
Thu, 15 Apr 1999 06:00:16 +0000 (06:00 +0000)
doc/src/sgml/jdbc.sgml

index 637752396f209fbba920fa3cd9162021fae9ce79..5339ec1f07d4d29667920ad21ca9a3e8a0519f59 100644 (file)
@@ -163,7 +163,7 @@ In the first method, your code implicitly loads the driver using the
 Class.forName() method. For Postgres, you would use:
 
 
-Class.forName(postgresql.Driver);
+Class.forName("postgresql.Driver");
 
 
 This will load the driver, and while loading, the driver will automatically
@@ -380,9 +380,9 @@ An example is as follows:
 
 
 Statement st = db.createStatement();
-ResultSet rs = st.executeQuery(select * from mytable);
+ResultSet rs = st.executeQuery("select * from mytable");
 while(rs.next()) {
-    System.out.print(Column 1 returned );
+    System.out.print("Column 1 returned ");
     System.out.println(rs.getString(1));
 }
 rs.close();
@@ -400,7 +400,7 @@ To perform an update (or any other SQL statement that does not return a
 result), you simply use the executeUpdate() method:
 
 
-st.executeUpdate(create table basic (a int2, b int2));
+st.executeUpdate("create table basic (a int2, b int2)");
 
 
 
@@ -455,9 +455,9 @@ create table images (imgname name,imgoid oid);
 To insert an image, you would use:
 
 
-File file = new File(myimage.gif);
+File file = new File("myimage.gif");
 FileInputStream fis = new FileInputStream(file);
-PreparedStatement ps = conn.prepareStatement(insert into images values (?,?));
+PreparedStatement ps = conn.prepareStatement("insert into images values (?,?)");
 ps.setString(1,file.getName());
 ps.setBinaryStream(2,fis,file.length());
 ps.executeUpdate();
@@ -477,8 +477,8 @@ Retrieving an image is even easier (I'm using PreparedStatement here, but
 Statement can equally be used):
 
 
-PreparedStatement ps = con.prepareStatement(select oid from images where name=?);
-ps.setString(1,myimage.gif);
+PreparedStatement ps = con.prepareStatement("select oid from images where name=?");
+ps.setString(1,"myimage.gif");
 ResultSet rs = ps.executeQuery();
 if(rs!=null) {
     while(rs.next()) {