play.db
Class DB

java.lang.Object
  extended by play.db.DB

public class DB
extends Object

Database connection utilities.


Field Summary
static DataSource datasource
          The loaded datasource.
 
Constructor Summary
DB()
           
 
Method Summary
static void close()
          Close the connection opened for the current thread.
static boolean execute(String SQL)
          Execute an SQL update
static ResultSet executeQuery(String SQL)
          Execute an SQL query
static Connection getConnection()
          Open a connection for the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datasource

public static DataSource datasource
The loaded datasource.

Constructor Detail

DB

public DB()
Method Detail

close

public static void close()
Close the connection opened for the current thread.


getConnection

public static Connection getConnection()
Open a connection for the current thread.

Returns:
A valid SQL connection

execute

public static boolean execute(String SQL)
Execute an SQL update

Parameters:
SQL -
Returns:
false if update failed

executeQuery

public static ResultSet executeQuery(String SQL)
Execute an SQL query

Parameters:
SQL -
Returns:
The query resultSet


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly