oracle.xml.dbviewer
Class DBViewer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--oracle.xml.dbviewer.DBViewer

public class DBViewer
extends javax.swing.JPanel
implements java.io.Serializable

Java bean that can be used to display database queries or any XML by applying XSL stylesheets and visualizing the resulted HTML in scrollable swing panel. This bean has tree buffers: XML, XSL and result buffer. The bean API allow the calling program to load/save the buffers from various sources and to apply stylesheet transformation to the XML buffer using the stylesheet in the XSL buffer. The result can be stored in the result buffer. The XML and XSL buffers content can be shown as source or as a tree structure. The result buffer content can be rendered as HTML and also shown as source or tree structure. The XML buffer can be loaded from database query. All buffers can load and save files from CLOB tables in Oracle database and from file system as well. Therefore, the control can be also used to move files between the file system and the user schema in the database.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
DBViewer()
          Constructs a new instance.
 
Method Summary
 java.lang.String getHostname()
          Get database host name
 java.lang.String getInstancename()
          Get database instance name
 java.lang.String getPassword()
          Get user password
 java.lang.String getPort()
          Get database port number
 java.lang.String getResBuffer()
          Get the content of the result buffer
 java.lang.String getResCLOBFileName()
          Get result CLOB file name
 java.lang.String getResCLOBTableName()
          Get result CLOB table name
 java.lang.String getResFileName()
          Get Result file name
 java.lang.String getUsername()
          Get user name
 java.lang.String getXmlBuffer()
          Get the content of the XML buffer
 java.lang.String getXmlCLOBFileName()
          Get XML CLOB file name
 java.lang.String getXmlCLOBTableName()
          Get XML CLOB table name
 java.lang.String getXmlFileName()
          Get XML file name
 java.lang.String getXMLStringFromSQL(java.lang.String sqlText)
          Get XML presentation of result set from SQL query
 java.lang.String getXslBuffer()
          Get the content of the XSL buffer
 java.lang.String getXslCLOBFileName()
          Get the XSL CLOB file name
 java.lang.String getXslCLOBTableName()
          Get XSL CLOB table name
 java.lang.String getXslFileName()
          Get XSL file name
 void loadResBuffer(java.lang.String filename)
          Load the result buffer from file
 void loadResBuffer(java.lang.String tablename, java.lang.String filename)
          Load the result buffer from CLOB file
 void loadResBuffer(XMLDocument resdoc)
          Load the result buffer from XMLDocument
 void loadResBufferFromClob()
          Load the result buffer from CLOB file
 void loadResBufferFromFile()
          Load the result buffer from file
 void loadXmlBuffer(java.lang.String filename)
          Load the XML buffer from file
 void loadXmlBuffer(java.lang.String tablename, java.lang.String filename)
          Load the XML buffer from CLOB file
 void loadXmlBuffer(XMLDocument xmldoc)
          Load the XML buffer from XMLDocument
 void loadXmlBufferFromClob()
          Load the XML buffer from CLOB file
 void loadXmlBufferFromFile()
          Load the XML buffer from file
 void loadXMLBufferFromSQL(java.lang.String sqltext)
          Load the XML buffer from SQL result set
 void loadXslBuffer(java.lang.String filename)
          Load the XSL buffer from file
 void loadXslBuffer(java.lang.String tablename, java.lang.String filename)
          Load the XSL buffer from CLOB file
 void loadXslBuffer(XMLDocument xsldoc)
          Load the XSL buffer from XMLDocument
 void loadXslBufferFromClob()
          Load the XSL buffer from CLOB file
 void loadXslBufferFromFile()
          Load the XSL buffer from file
 XMLDocument parseResBuffer()
          Parse the result buffer and refresh the tree view and source view
 XMLDocument parseXmlBuffer()
          Parse the XML buffer and refresh the tree view and source view
 XMLDocument parseXslBuffer()
          Parse the XSL buffer and refresh the tree view and source view
 void saveResBuffer(java.lang.String filename)
          Save the result buffer to file
 void saveResBuffer(java.lang.String tablename, java.lang.String filename)
          Save the result buffer to CLOB file
 void saveResBufferToClob()
          Save the result buffer to CLOB file
 void saveResBufferToFile()
          Save the result buffer to file
 void saveXmlBuffer(java.lang.String filename)
          Save the XML buffer to file
 void saveXmlBuffer(java.lang.String tablename, java.lang.String filename)
          Save the XML buffer to CLOB file
 void saveXmlBufferToClob()
          Save the XML buffer to CLOB file
 void saveXmlBufferToFile()
          Save the XML buffer to file
 void saveXslBuffer(java.lang.String filename)
          Save the XSL buffer to file
 void saveXslBuffer(java.lang.String tablename, java.lang.String filename)
          Save the XSL buffer to CLOB file
 void saveXslBufferToClob()
          Save the XSL buffer to CLOB file
 void saveXslBufferToFile()
          Save the XSL buffer to file
 void setHostname(java.lang.String hostname)
          Set database host name
 void setInstancename(java.lang.String instancename)
          Set database instance name
 void setPassword(java.lang.String password)
          Set user password
 void setPort(java.lang.String port)
          Set database port number
 void setResBuffer(java.lang.String text)
          Set new text in the result buffer
 void setResCLOBFileName(java.lang.String name)
          Set Result CLOB file name
 void setResCLOBTableName(java.lang.String name)
          Set Result CLOB table name
 void setResFileName(java.lang.String name)
          Set Result file name
 void setResHtmlView(boolean on)
          Show the result buffer as rendered HTML
 void setResSourceEditView(boolean on)
          Show the result buffer as XML source and enter edit mode
 void setResSourceView(boolean on)
          Show the result buffer as XML source
 void setResTreeView(boolean on)
          Show the result buffer as XML tree view
 void setUsername(java.lang.String username)
          Set user name
 void setXmlBuffer(java.lang.String text)
          Set new text in the XML buffer
 void setXmlCLOBFileName(java.lang.String name)
          Set XML CLOB table name
 void setXmlCLOBTableName(java.lang.String name)
          Set XML CLOB table name
 void setXmlFileName(java.lang.String name)
          Set XML file name
 void setXmlSourceEditView(boolean on)
          Show the XML buffer as XML source and enter edit mode
 void setXmlSourceView(boolean on)
          Show the XML buffer as XML source
 void setXmlTreeView(boolean on)
          Show the XML buffer as tree
 void setXslBuffer(java.lang.String text)
          Set new text in the XSL buffer
 void setXslCLOBFileName(java.lang.String name)
          Set XSL CLOB file name
 void setXslCLOBTableName(java.lang.String name)
          Set XSL CLOB table name
 void setXslFileName(java.lang.String name)
          Set XSL file name
 void setXslSourceEditView(boolean on)
          Show the XSL buffer as XML source and enter edit mode
 void setXslSourceView(boolean on)
          Show the XSL buffer as XML source
 void setXslTreeView(boolean on)
          Show the XSL buffer as tree
 XMLDocument transformToDoc()
          Transfroms the content of the XML buffer by applying the stylesheet from the XSL buffer.
 void transformToRes()
          Apply the stylesheet transformation from the XSL buffer to the XML in the XML buffer and stores the result into the result buffer
 java.lang.String transformToString()
          Transfroms the content of the XML buffer by applying the stylesheet from the XSL buffer.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBViewer

public DBViewer()
Constructs a new instance.
Method Detail

setUsername

public void setUsername(java.lang.String username)
Set user name
Parameters:
username - the user name

getUsername

public java.lang.String getUsername()
Get user name
Returns:
user name

setPassword

public void setPassword(java.lang.String password)
Set user password
Parameters:
password - the user password

getPassword

public java.lang.String getPassword()
Get user password
Returns:
user password

setHostname

public void setHostname(java.lang.String hostname)
Set database host name
Parameters:
hostname - the host name

getHostname

public java.lang.String getHostname()
Get database host name
Returns:
host name

setPort

public void setPort(java.lang.String port)
Set database port number
Parameters:
port - String containing the port number

getPort

public java.lang.String getPort()
Get database port number
Returns:
String with the database port number

setInstancename

public void setInstancename(java.lang.String instancename)
Set database instance name
Parameters:
instancename - the database instance name

getInstancename

public java.lang.String getInstancename()
Get database instance name
Returns:
database instance name

setXmlFileName

public void setXmlFileName(java.lang.String name)
Set XML file name
Parameters:
name - XML file name

setXmlCLOBTableName

public void setXmlCLOBTableName(java.lang.String name)
Set XML CLOB table name
Parameters:
name - XML CLOB table name

setXmlCLOBFileName

public void setXmlCLOBFileName(java.lang.String name)
Set XML CLOB table name
Parameters:
name - XML CLOB table name

getXmlFileName

public java.lang.String getXmlFileName()
Get XML file name
Returns:
XML file name

getXmlCLOBTableName

public java.lang.String getXmlCLOBTableName()
Get XML CLOB table name
Returns:
XML CLOB table name

getXmlCLOBFileName

public java.lang.String getXmlCLOBFileName()
Get XML CLOB file name
Returns:
XML CLOB file name

setXslFileName

public void setXslFileName(java.lang.String name)
Set XSL file name
Parameters:
name - XSL file name

setXslCLOBTableName

public void setXslCLOBTableName(java.lang.String name)
Set XSL CLOB table name
Parameters:
name - XSL CLOB table name

setXslCLOBFileName

public void setXslCLOBFileName(java.lang.String name)
Set XSL CLOB file name
Parameters:
name - XSL CLOB file name

getXslFileName

public java.lang.String getXslFileName()
Get XSL file name
Returns:
XSL file name

getXslCLOBTableName

public java.lang.String getXslCLOBTableName()
Get XSL CLOB table name
Returns:
XSL CLOB table name

getXslCLOBFileName

public java.lang.String getXslCLOBFileName()
Get the XSL CLOB file name
Returns:
XSL CLOB file name

setResFileName

public void setResFileName(java.lang.String name)
Set Result file name
Parameters:
name - Result file name

setResCLOBTableName

public void setResCLOBTableName(java.lang.String name)
Set Result CLOB table name
Parameters:
name - Result CLOB table name

setResCLOBFileName

public void setResCLOBFileName(java.lang.String name)
Set Result CLOB file name
Parameters:
name - Result CLOB file name

getResFileName

public java.lang.String getResFileName()
Get Result file name
Returns:
XSL file name

getResCLOBTableName

public java.lang.String getResCLOBTableName()
Get result CLOB table name
Returns:
result CLOB table name

getResCLOBFileName

public java.lang.String getResCLOBFileName()
Get result CLOB file name
Returns:
result CLOB file name

loadXmlBuffer

public void loadXmlBuffer(java.lang.String tablename,
                          java.lang.String filename)
                   throws java.lang.Exception
Load the XML buffer from CLOB file
Parameters:
tablename - CLOB table name
filename - CLOB file name

loadXmlBuffer

public void loadXmlBuffer(XMLDocument xmldoc)
                   throws java.lang.Exception
Load the XML buffer from XMLDocument
Parameters:
filename - file name

loadXmlBuffer

public void loadXmlBuffer(java.lang.String filename)
                   throws java.lang.Exception
Load the XML buffer from file
Parameters:
filename - file name

loadXmlBufferFromClob

public void loadXmlBufferFromClob()
                           throws java.lang.Exception
Load the XML buffer from CLOB file

loadXmlBufferFromFile

public void loadXmlBufferFromFile()
                           throws java.lang.Exception
Load the XML buffer from file

loadXMLBufferFromSQL

public void loadXMLBufferFromSQL(java.lang.String sqltext)
                          throws java.lang.Exception
Load the XML buffer from SQL result set
Parameters:
sqltext - SQL text

saveXmlBufferToClob

public void saveXmlBufferToClob()
                         throws java.lang.Exception
Save the XML buffer to CLOB file

saveXmlBufferToFile

public void saveXmlBufferToFile()
                         throws java.lang.Exception
Save the XML buffer to file

saveXmlBuffer

public void saveXmlBuffer(java.lang.String tablename,
                          java.lang.String filename)
                   throws java.lang.Exception
Save the XML buffer to CLOB file
Parameters:
tablename - CLOB table name
filename - CLOB file name

saveXmlBuffer

public void saveXmlBuffer(java.lang.String filename)
                   throws java.lang.Exception
Save the XML buffer to file
Parameters:
filename - file name

parseXmlBuffer

public XMLDocument parseXmlBuffer()
                           throws java.lang.Exception
Parse the XML buffer and refresh the tree view and source view
Returns:
XMLDocument

setXmlBuffer

public void setXmlBuffer(java.lang.String text)
Set new text in the XML buffer
Parameters:
text - XML text

getXmlBuffer

public java.lang.String getXmlBuffer()
Get the content of the XML buffer
Returns:
the buffer content

getXMLStringFromSQL

public java.lang.String getXMLStringFromSQL(java.lang.String sqlText)
                                     throws java.lang.Exception
Get XML presentation of result set from SQL query
Returns:
the query result set as XML string

loadXslBuffer

public void loadXslBuffer(java.lang.String tablename,
                          java.lang.String filename)
                   throws java.lang.Exception
Load the XSL buffer from CLOB file
Parameters:
tablename - CLOB table name
filename - CLOB file name

loadXslBuffer

public void loadXslBuffer(java.lang.String filename)
                   throws java.lang.Exception
Load the XSL buffer from file
Parameters:
filename - file name

loadXslBuffer

public void loadXslBuffer(XMLDocument xsldoc)
                   throws java.lang.Exception
Load the XSL buffer from XMLDocument
Parameters:
xsldoc - - the XML Document

loadXslBufferFromClob

public void loadXslBufferFromClob()
                           throws java.lang.Exception
Load the XSL buffer from CLOB file

loadXslBufferFromFile

public void loadXslBufferFromFile()
                           throws java.lang.Exception
Load the XSL buffer from file

saveXslBufferToClob

public void saveXslBufferToClob()
                         throws java.lang.Exception
Save the XSL buffer to CLOB file

saveXslBufferToFile

public void saveXslBufferToFile()
                         throws java.lang.Exception
Save the XSL buffer to file

saveXslBuffer

public void saveXslBuffer(java.lang.String tablename,
                          java.lang.String filename)
                   throws java.lang.Exception
Save the XSL buffer to CLOB file
Parameters:
tablename - CLOB table name
filename - CLOB file name

saveXslBuffer

public void saveXslBuffer(java.lang.String filename)
                   throws java.lang.Exception
Save the XSL buffer to file
Parameters:
filename - file name

parseXslBuffer

public XMLDocument parseXslBuffer()
                           throws java.lang.Exception
Parse the XSL buffer and refresh the tree view and source view
Returns:
XMLDocument

setXslBuffer

public void setXslBuffer(java.lang.String text)
Set new text in the XSL buffer
Parameters:
text - XSL text

getXslBuffer

public java.lang.String getXslBuffer()
Get the content of the XSL buffer
Returns:
the buffer content

loadResBuffer

public void loadResBuffer(java.lang.String tablename,
                          java.lang.String filename)
                   throws java.lang.Exception
Load the result buffer from CLOB file
Parameters:
tablename - CLOB table name
filename - CLOB file name

loadResBuffer

public void loadResBuffer(java.lang.String filename)
                   throws java.lang.Exception
Load the result buffer from file
Parameters:
filename - file name

loadResBuffer

public void loadResBuffer(XMLDocument resdoc)
                   throws java.lang.Exception
Load the result buffer from XMLDocument
Parameters:
resdoc - - the XMLDocument

loadResBufferFromClob

public void loadResBufferFromClob()
                           throws java.lang.Exception
Load the result buffer from CLOB file

loadResBufferFromFile

public void loadResBufferFromFile()
                           throws java.lang.Exception
Load the result buffer from file

saveResBufferToClob

public void saveResBufferToClob()
                         throws java.lang.Exception
Save the result buffer to CLOB file

saveResBufferToFile

public void saveResBufferToFile()
                         throws java.lang.Exception
Save the result buffer to file

saveResBuffer

public void saveResBuffer(java.lang.String tablename,
                          java.lang.String filename)
                   throws java.lang.Exception
Save the result buffer to CLOB file
Parameters:
tablename - CLOB table name
filename - CLOB file name

saveResBuffer

public void saveResBuffer(java.lang.String filename)
                   throws java.lang.Exception
Save the result buffer to file
Parameters:
filename - CLOB file name

parseResBuffer

public XMLDocument parseResBuffer()
                           throws java.lang.Exception
Parse the result buffer and refresh the tree view and source view
Returns:
XMLDocument

setResBuffer

public void setResBuffer(java.lang.String text)
Set new text in the result buffer
Parameters:
text - the new text

getResBuffer

public java.lang.String getResBuffer()
Get the content of the result buffer
Returns:
the buffer content

transformToRes

public void transformToRes()
Apply the stylesheet transformation from the XSL buffer to the XML in the XML buffer and stores the result into the result buffer

transformToDoc

public XMLDocument transformToDoc()
Transfroms the content of the XML buffer by applying the stylesheet from the XSL buffer.

transformToString

public java.lang.String transformToString()
Transfroms the content of the XML buffer by applying the stylesheet from the XSL buffer.

setXmlSourceView

public void setXmlSourceView(boolean on)
Show the XML buffer as XML source

setXmlSourceEditView

public void setXmlSourceEditView(boolean on)
Show the XML buffer as XML source and enter edit mode

setXmlTreeView

public void setXmlTreeView(boolean on)
Show the XML buffer as tree

setXslSourceView

public void setXslSourceView(boolean on)
Show the XSL buffer as XML source

setXslSourceEditView

public void setXslSourceEditView(boolean on)
Show the XSL buffer as XML source and enter edit mode

setXslTreeView

public void setXslTreeView(boolean on)
Show the XSL buffer as tree

setResHtmlView

public void setResHtmlView(boolean on)
Show the result buffer as rendered HTML

setResSourceView

public void setResSourceView(boolean on)
Show the result buffer as XML source

setResSourceEditView

public void setResSourceEditView(boolean on)
Show the result buffer as XML source and enter edit mode

setResTreeView

public void setResTreeView(boolean on)
Show the result buffer as XML tree view


 

Copyright © 1997, 2004, Oracle. All rights reserved.