July 2005
Intermediate to advanced
1032 pages
27h 10m
English
Now, let's move on to the final JDBC client. As in previous chapters, we'll wrap up by looking at an application that processes arbitrary commands entered by the user.
Listing 13.9 shows the client4.main() method.
1 // 2 // File: client4.java 3 // 4 5 import java.sql.*; 6 import java.io.*; 7 8 public class client4 9 { 10 static String blanks = " "; 11 static String dashes = "-----------------------------------"; 12 13 public static void main( String args[] ) 14 throws SQLException 15 { 16 Class driverClass = loadDriver( "org.postgresql.Driver" ); 17 18 if( driverClass == null ) 19 return; 20 21 if( args.length != 1 ) 22 { 23 System.err.println( "usage: java client4 ... |
Read now
Unlock full access