FileDocCategorySizeDatePackage
TestDefaultConnection2.javaAPI DocExample568Sat Oct 28 16:24:44 BST 2000None

TestDefaultConnection2

public class TestDefaultConnection2 extends Object

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

  OracleDriver oracleDriver = new OracleDriver();
  Connection conn = 
   oracleDriver.defaultConnection();
  Statement  stmt = conn.createStatement();
  ResultSet  rset = stmt.executeQuery(
   "select 'Hello '||initcap(USER)||'!' result from dual");
  String greeting = null;
  if (rset.next()) 
   greeting = rset.getString(1);
  rset.close();
  stmt.close();
  conn.close();
  return greeting;