Package org.pentaho.di.core
Class SQLStatement
- java.lang.Object
 - 
- org.pentaho.di.core.SQLStatement
 
 
- 
public class SQLStatement extends Object
This class contains all that is needed to execute an SQL statement in a database. --> The Database connection --> The SQL statement- Since:
 - 02-dec-2004
 - Author:
 - Matt
 
 
- 
- 
Constructor Summary
Constructors Constructor Description SQLStatement(String stepname, DatabaseMeta dbinfo, String sql)Creates a new SQLStatement 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatabaseMetagetDatabase()Get the database connection for this SQL StatementStringgetError()Get the error that occurred when obtaining the SQL.StringgetSQL()Get the SQL for this SQL StatementStringgetStepname()Return the name of the step for which the SQL is intendedbooleanhasError()Checks whether or not an error occurred obtaining the SQL.booleanhasSQL()Checks whether or not SQL statements are presentvoidsetDatabase(DatabaseMeta dbinfo)Sets the database connection for this SQL StatementvoidsetError(String error)Sets the error that occurred when obtaining the SQL.voidsetSQL(String sql)Sets the SQL to execute for this SQL Statement.voidsetStepname(String stepname)Set the name of the step for which the SQL is intended 
 - 
 
- 
- 
Constructor Detail
- 
SQLStatement
public SQLStatement(String stepname, DatabaseMeta dbinfo, String sql)
Creates a new SQLStatement- Parameters:
 dbinfo- The database connectionsql- The sql to execute on the connection
 
 - 
 
- 
Method Detail
- 
setStepname
public void setStepname(String stepname)
Set the name of the step for which the SQL is intended- Parameters:
 stepname- the name of the step for which the SQL is intended
 
- 
getStepname
public String getStepname()
Return the name of the step for which the SQL is intended- Returns:
 - The name of the step for which the SQL is intended
 
 
- 
setDatabase
public void setDatabase(DatabaseMeta dbinfo)
Sets the database connection for this SQL Statement- Parameters:
 dbinfo- The databaseconnection
 
- 
setSQL
public void setSQL(String sql)
Sets the SQL to execute for this SQL Statement.- Parameters:
 sql- The sql to execute, without trailing ";" or anything else.
 
- 
getDatabase
public DatabaseMeta getDatabase()
Get the database connection for this SQL Statement- Returns:
 - The database connection for this SQL Statement
 
 
- 
getSQL
public String getSQL()
Get the SQL for this SQL Statement- Returns:
 - The SQL to execute for this SQL Statement
 
 
- 
setError
public void setError(String error)
Sets the error that occurred when obtaining the SQL.- Parameters:
 error- The error that occurred when obtaining the SQL.
 
- 
getError
public String getError()
Get the error that occurred when obtaining the SQL.- Returns:
 - the error that occurred when obtaining the SQL.
 
 
- 
hasError
public boolean hasError()
Checks whether or not an error occurred obtaining the SQL.- Returns:
 - true if an error is set, false if no error is set.
 
 
- 
hasSQL
public boolean hasSQL()
Checks whether or not SQL statements are present- Returns:
 - true if changes are present, false if this is not the case.
 
 
 - 
 
 -