
Chapter 4: Data Access Using JDBC
The serverMain( ) method
// A JDBCExamples method equivalent to 'main',
// to be called from SQL or Java in the server
public static String serverMain(String action) {
try {
Connection con = connecter("default");
String workString = doAction(action, con, server);
return workString;
} catch ( Exception e ) {
if (e.getMessage().equals(null)) {
return "Exc: " + e.toString();
} else {
return "Exc - " + e.getMessage();
}
}
}
Copyright © 2005. Sybase Inc. All rights reserved.
|
|
View this book as PDF 