|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--com.faa.flyfaa.FlyfaaDbBean
JavaBean used for interacting with the database. The flyFAA startup servlet, FlyFAAPoolServlet, creates an instance of OracleConnectionCacheImpl which is saved in the servlet context as a property called "dbcache" from which this class creates database connections using OracleConnectionCacheImpl's getConnection() method. Some other methods of interest provided by this class are:
Field Summary | |
private oracle.jdbc.pool.OracleConnectionCacheImpl |
cache
Cache of database connection pools established at application start-up time. |
private javax.servlet.ServletConfig |
cfg
Pointer to the ServletConfig. |
private java.lang.String |
Logf
Pointer to the log file, which will be named FLYlogyyyy_Monddhhmm.txt (for example, FLYlog2003_Jan291940.txt) and is currently set up to reside in the /web/trace/atcscc/java_logs directory. |
private FlyFAAProjectBean |
project
Pointer to the Project Bean |
(package private) java.lang.String |
strDD
String to contain the HTML data produced by FillDelayData |
Fields inherited from class javax.servlet.http.HttpServlet |
HEADER_IFMODSINCE, HEADER_LASTMOD, LSTRING_FILE, lStrings, METHOD_DELETE, METHOD_GET, METHOD_HEAD, METHOD_OPTIONS, METHOD_POST, METHOD_PUT, METHOD_TRACE |
Fields inherited from class javax.servlet.GenericServlet |
config |
Constructor Summary | |
FlyfaaDbBean()
Database access bean constructor. |
Method Summary | |
java.lang.String |
banner(java.lang.String bgcolor,
java.lang.String word2,
java.lang.String word3)
Generates the title banner for an error message. |
void |
closeConnectionObject(java.sql.Connection conn)
Closes a given Connection object. |
long |
ComputeElapsedTime(long t1,
long t2)
Returns a long representing the absolute value of the difference between one time given in a long variable and a second time given in a long variable. |
java.sql.Connection |
connect()
Makes a connection to the database as long as the 'cache' property has been set. |
java.lang.String |
ConvertMins(double nMins)
Converts minutes to hours and minutes. |
void |
destroy()
|
java.lang.String |
execGetCenters(java.lang.String keyword,
java.sql.Connection conn)
Calls the database stored procedure OIS.GET_CENTERS to get a list of centers associated with a keyword (like 'NOWEST' or 'ZDC1'). |
boolean |
execGetNewTMIs()
Executes code similar to the database stored procedure OIS.NEW_TMIS to find out if there are any new Traffic Management Initiatives since the last time that the DatabaseUpdater ran. |
java.lang.String |
execGetTip(java.lang.String airport,
java.sql.Connection conn)
Calls the database stored procedure OIS.GET_TIP_LOCAL to get a tool tip for an airport. |
java.sql.ResultSet |
execQuery(java.lang.String sql,
java.sql.Connection conn)
Executes an SQL query given as sql using the given Connection. |
int |
execUpdate(java.sql.Connection conn,
java.lang.String sql)
Executes an SQL INSERT, UPDATE or DELETE command. |
oracle.jdbc.pool.OracleConnectionCacheImpl |
getCache()
Gets the FlyfaaDbBean's "cache" property (an object of type OracleConnectionCacheImpl), which was initially instantiated by the start-up servlet FlyFAAPoolServlet. |
java.util.Calendar |
getGMTCalendar()
Gets a GMT Calendar. |
java.util.Calendar |
getGMTCalendar(int year,
int month,
int date,
int hour,
int minute)
Gets a GMT Calendar with a specified date and time. |
boolean |
getLock(FlyFAAProjectBean b)
Gets the lock flag for the flyFAA Java Application from the FlyFAAProjectBean. |
java.lang.String |
getstrDD()
Gets the FlyfaaDbBean's "strDD" property |
java.lang.String |
PartialSeconds(long t)
Returns a string representation of a time given in a long variable formatted in seconds and milliseconds. |
java.lang.String |
SecondsOut(long time1,
long time2)
Computes the time difference between two times (in long variables) and returns a string representing the time difference in seconds and milliseconds. |
void |
setCache(oracle.jdbc.pool.OracleConnectionCacheImpl occi)
Sets the FlyfaaDbBean's "cache" property to the given OracleConnectionCacheImpl, which is set up by the start-up servlet FlyFAAPoolServlet. |
void |
setProject(FlyFAAProjectBean proj)
Sets the FlyfaaDbBean's "project" property to the given FlyFAAProjectBean. |
void |
setstrDD(java.lang.String s)
Sets the FlyfaaDbBean's "strDD" property to the given String. |
Methods inherited from class javax.servlet.http.HttpServlet |
|
Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Field Detail |
private java.lang.String Logf
java.lang.String strDD
private oracle.jdbc.pool.OracleConnectionCacheImpl cache
private FlyFAAProjectBean project
private javax.servlet.ServletConfig cfg
Constructor Detail |
public FlyfaaDbBean()
Method Detail |
public void setstrDD(java.lang.String s)
FillDelayData
.
s
- String of HTML produced by FillDelayDatapublic java.lang.String getstrDD()
public void setProject(FlyFAAProjectBean proj)
proj
- FlyFAAProjectBean object referencepublic void setCache(oracle.jdbc.pool.OracleConnectionCacheImpl occi)
occi
- OracleConnectionCacheImpl to use as the database connection
pool cachepublic oracle.jdbc.pool.OracleConnectionCacheImpl getCache()
public java.sql.Connection connect() throws java.sql.SQLException, java.io.IOException
Connection
- a Connection to the databasejava.sql.SQLException
- if a database access error occursjava.io.IOException
- if a connection cannot be obtained within 5 secondspublic void destroy()
destroy
in class javax.servlet.GenericServlet
public void closeConnectionObject(java.sql.Connection conn) throws java.sql.SQLException
conn
- The Connection object to be closedjava.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet execQuery(java.lang.String sql, java.sql.Connection conn) throws java.sql.SQLException
sql
using the given Connection.
sql
- String containing an SQL query (which should produce a ResultSet)
to be executed by the databaseconn
- A database connection objectResultSet
- the ResultSet produced by the given queryjava.sql.SQLException
- if a database access error occurspublic int execUpdate(java.sql.Connection conn, java.lang.String sql) throws java.sql.SQLException
conn
- Connection objectsql
- String containing an SQL INSERT
, UPDATE
or
DELETE
statement or an SQL statement that returns nothingint
- either the row count for INSERT
, UPDATE
or
DELETE
statements, or 0 for SQL statements that return nothingjava.sql.SQLException
- if a database access error occurspublic java.lang.String execGetTip(java.lang.String airport, java.sql.Connection conn) throws java.sql.SQLException, java.io.IOException
airport
- Airport ID for which the tooltip is to be obtainedconn
- handle to a database Connection object; if null, this method will try
to obtain a connectionString
- containing tool tip text in HTML
java.sql.SQLException
- If a database access error occursjava.io.IOException
- if conn
is null and a Connection cannot be
obtained within 5 secondspublic boolean execGetNewTMIs() throws java.lang.Exception
getDbStartTime()
). This method
detects deleted records by checking the DELETED_TIME column.
true
- if there are new Traffic Management Initiatives, indicating
that the DatabaseUpdater should run, false
otherwise.
java.sql.SQLException
- if a database access error occursjava.io.IOException
- if a Connection cannot be obtained within 5 secondspublic java.lang.String execGetCenters(java.lang.String keyword, java.sql.Connection conn) throws java.sql.SQLException, java.io.IOException
keyword
- keyword which corresponds to a list of centersconn
- handle to a database Connection object; if null, this method will try
to obtain a connectionString
- containing list of centers associated with the keyword
java.sql.SQLException
- If a database access error occursjava.io.IOException
- if conn
is null and a Connection cannot be
obtained within 5 secondspublic java.lang.String banner(java.lang.String bgcolor, java.lang.String word2, java.lang.String word3)
bgcolor
- String containing the background color for the banner
(include the #)word2
- String with the first word to be shown in the bannerword3
- String with the second word to be shown in the bannerString
- HTML code containing the banner tablepublic boolean getLock(FlyFAAProjectBean b)
b
- FlyFAAProjectBean referencetrue
only after the lock is obtainedpublic java.util.Calendar getGMTCalendar()
Calendar
in the GMT timezone without any time being set.public java.util.Calendar getGMTCalendar(int year, int month, int date, int hour, int minute)
year
- int containing the year of the date to which the calendar is being setmonth
- int containing the month of the date to which the calendar is being set (0-based)date
- int containing the day of the month of the date to which the calendar is being sethour
- int containing the hour of the date to which the calendar is being setminute
- int containing the minute of the date to which the calendar is being setCalendar
in the GMT timezone while setting the given time.public java.lang.String SecondsOut(long time1, long time2)
time1
- long representing one of the timestime2
- long representing the other timepublic java.lang.String PartialSeconds(long t)
t
- long representing a time in millisecondspublic long ComputeElapsedTime(long t1, long t2)
t1
- long representing one of the timest2
- long representing the other timepublic java.lang.String ConvertMins(double nMins)
nMins
- double number of minutes to be convertedString
representing the number of minutes expressed in terms
of hour(s) and minute(s)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |