printVal is changed to return # of characters printed.
[csql.git] / tmptest / example.java
blob6969b605de7417ce05b00f08e8bacccfc2cf6cbe
1 import java.sql.*;
3 public class example
5 public static void main( String argv[] )
7 try
9 Class.forName("csql.jdbc.JdbcSqlDriver");
10 // Connection handle
11 Connection con = DriverManager.getConnection("jdbc:csql", "praba", "manager");
12 // Statement handle
13 PreparedStatement stmt = con.prepareStatement("UPDATE t1 set f2 = ? WHERE f1 = ?");
14 for (int i =0 ; i< 10 ; i++) {
15 stmt.setInt(1, i+200);
16 stmt.setInt(2, i);
17 stmt.executeUpdate();
19 stmt.close();
20 con.commit();
21 con.close();
22 }catch(Exception e) {
23 System.out.println("example: "+e);
24 e.getStackTrace();