FileDocCategorySizeDatePackage
TestDefaultConnection.javaAPI DocExample697Sat Oct 28 16:19:36 BST 2000None

TestDefaultConnection

public class TestDefaultConnection extends Object

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.StringgetGreeting()

// no need to load the driver any more
// Class.forName("oracle.jdbc.driver.OracleDriver");
// or you can use:
//  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
  String greeting = null;
  Connection conn = 
   DriverManager.getConnection("jdbc:default:connection:");
  Statement  stmt = conn.createStatement();
  ResultSet  rset = stmt.executeQuery(
   "select 'Hello '||initcap(USER)||'!' result from dual");
  if (rset.next()) 
   greeting = rset.getString(1);
  rset.close();
  stmt.close();
  conn.close();
  return greeting;