|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
rdbms.MetaBeanFrame
public class MetaBeanFrame
Facade pattern implementation for JDBC This init method creates the connection to the database and retrieves additional database information.
Field Summary |
---|
Fields inherited from class javax.swing.JFrame |
---|
EXIT_ON_CLOSE |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
MetaBeanFrame()
Constructor. |
Method Summary | |
---|---|
void |
close()
Closes the connections to this database. |
java.lang.String |
getCatalogName()
Gets this Connection's current catalog name. |
int |
getColumnCount(java.sql.ResultSetMetaData _rsmd)
Gets the number of columns in a ResultSet. |
java.lang.String[] |
getColumnTypeNames(java.sql.ResultSetMetaData _rsmd)
Gets the database types of the columns in a ResultSet. |
java.lang.String |
getCurrentQuery()
Gets the value of this current SQL. |
java.sql.DatabaseMetaData |
getDatabaseMetaData()
Gets this DataBaseMetaData object. |
java.lang.String |
getDriverName()
Gets the name of this JDBC driver. |
java.lang.String |
getKeyWords()
Gets the keywords associated with this database. |
int |
getNumberofRows(java.util.Vector v)
Converts a ResultSet to a Vector of Strings. |
java.lang.String |
getProductName()
Gets the name of this database product. |
boolean |
getReadOnly()
Gets whether or not this connection to this database is read only. |
java.util.Vector |
getRecords(java.sql.ResultSet _rs)
|
java.sql.ResultSet |
getResultSet()
Gets the ResultSet contained in this instance variable rs. |
java.sql.ResultSetMetaData |
getResultSetMetaData(java.sql.ResultSet _rs)
Gets the MetaData for a specified ResultSet. |
java.lang.String[] |
getRowAsString(java.sql.ResultSet _rs)
Converts a row in a ResultSet to a String. |
java.lang.String[] |
getTableFields(java.sql.ResultSetMetaData _rsmd)
Gets the names of the columns (fields) in a provided ResultSet. |
java.lang.String |
getTableName()
Gets the value of this current table name. |
java.lang.String[] |
getTableNames(java.sql.DatabaseMetaData dbmd,
java.lang.String userid)
Gets the table names contained in this current database. |
java.sql.ResultSet |
getTableTypes()
Gets the table types available in this database connection. |
boolean |
getUsesLocalFiles()
Determines if database uses a local file. |
void |
init()
Loads specified driver and initializes the Connection to this Database. |
void |
modifyDatabase(java.sql.Connection c,
java.lang.String sql)
Process an SQL INSERT, DELETE or UPDATE statement string. |
void |
moveToTop(java.sql.ResultSet _rs)
Moves to the top of this RecordSet. |
boolean |
nextRow(java.sql.ResultSet _rs)
Moves to the next row of a provided ResultSet. |
void |
print(java.sql.ResultSet _rs)
Prints the contents of a provided ResultSet. |
void |
printDataBaseInfo()
Prints information about this database connection. |
void |
println(java.lang.Object o)
Prints the contents of a provided Object. |
void |
println(java.lang.String[] s)
Prints the contents of a String array. |
void |
printResultSetInfo(java.sql.ResultSet _rs)
Prints information about this current ResultSet. |
java.sql.ResultSet |
query(java.sql.Connection c,
java.lang.String sql)
Creates a Result Set based on an sql query. |
void |
setDriver(java.lang.String _driver)
Sets the name of the instance variable, driver, which this class is loadeding. |
void |
setPassword(java.lang.String _password)
Sets this classes instance variable, password, for this database connection. |
void |
setTableName(java.lang.String _tablename)
Sets this classes instance variable, tablename, for the current database tablename. |
void |
setUrl(java.lang.String _url)
Sets this classes instance variable, url, for this database url. |
void |
setUserId(java.lang.String _userId)
Sets this classes instance variable, userId, for this database connection. |
Methods inherited from class javax.swing.JFrame |
---|
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Constructor Detail |
---|
public MetaBeanFrame()
Method Detail |
---|
public boolean getUsesLocalFiles()
public boolean getReadOnly()
public java.lang.String getCatalogName()
public java.lang.String getDriverName()
public java.lang.String getProductName()
public java.sql.ResultSet getResultSet()
public java.lang.String getTableName()
public java.lang.String getCurrentQuery()
public java.lang.String[] getTableNames(java.sql.DatabaseMetaData dbmd, java.lang.String userid)
public java.sql.ResultSet getTableTypes()
public void setUserId(java.lang.String _userId)
_userId
- the database UserIdpublic void setPassword(java.lang.String _password)
_password
- the database Passwordpublic void setUrl(java.lang.String _url)
_url
- the database urlpublic void setDriver(java.lang.String _driver)
_driver
- the driver namepublic void setTableName(java.lang.String _tablename)
_tablename
- the database tablenamepublic void init()
Loads the driver and Connects to the Database
Retrieves and sets Database/
Connection Information as follows:
  MetaData of this Database
  Read Only Property
  Uses Local Files Property
  Driver Name Used for the Connection
  Database Product Name
  Table Types in this Database
public void printDataBaseInfo()
Prints the following information:
  The name of this database product
  This Connection's current catalog name
  Is this connection in read-only mode
  Does this database store tables in a local files
  The name of this JDBC driver
  The SQL keywords of this database
  The table types of all the tables in this database
  The names of all the tables in this database
  The names of all the non-system tables in this database
public void printResultSetInfo(java.sql.ResultSet _rs)
Prints the following information:
  The column names (fields) of this database
  The type name of the columns (fields) used by this database
_rs
- the current ResultSetpublic void close()
public java.sql.ResultSet query(java.sql.Connection c, java.lang.String sql)
c
- the sql query
public java.sql.ResultSetMetaData getResultSetMetaData(java.sql.ResultSet _rs)
_rs
- the ResultSet
public int getColumnCount(java.sql.ResultSetMetaData _rsmd)
_rsmd
- the ResultSetMetaData
public java.lang.String getKeyWords()
public java.lang.String[] getColumnTypeNames(java.sql.ResultSetMetaData _rsmd)
_rsmd
- the ResultSetMetaData
public java.lang.String[] getRowAsString(java.sql.ResultSet _rs)
_rs
- the ResultSet pointed to a particular row
public int getNumberofRows(java.util.Vector v)
_rs
- the ResultSetv
- the Vector
public void moveToTop(java.sql.ResultSet _rs)
_rs
- the ResultSetpublic void print(java.sql.ResultSet _rs)
_rs
- the ResultSetpublic java.util.Vector getRecords(java.sql.ResultSet _rs)
public void println(java.lang.Object o)
o
- the Objectpublic void println(java.lang.String[] s)
s
- the arraypublic boolean nextRow(java.sql.ResultSet _rs)
_rs
- the ResultSetpublic java.lang.String[] getTableFields(java.sql.ResultSetMetaData _rsmd)
_rsmd
- the ResultSetMetaData
public java.sql.DatabaseMetaData getDatabaseMetaData()
public void modifyDatabase(java.sql.Connection c, java.lang.String sql)
sql
- the SQL INSERT, UPDATE or DELETE statement
or an SQL statement that returns nothing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |