FileDocCategorySizeDatePackage
TestInternalConnection.javaAPI DocExample684Mon May 21 17:00:56 BST 2001None

TestInternalConnection

public class TestInternalConnection extends Object

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

// With 8.1.6 there's no need to load the driver any more,
// but it doesn't hurt anything if you do.
  Class.forName("oracle.jdbc.driver.OracleDriver");
  String greeting = null;
  Connection conn = 
   DriverManager.getConnection("jdbc:oracle:kprb:");
  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;