0N/AThe four examples in this directory show how to use some of the
0N/Afeatures of the JTable component.
0N/A
0N/ATableExample:
0N/A This application includes a GUI for configuring the
0N/A database connection and specifying the query.
0N/ATableExample2:
0N/A The query and database connection are specified at the command
0N/A line. The results are displayed in a JTable.
0N/ATableExample3:
0N/A Is a minimal example showing how to plug a generic sorter into the
0N/A JTable.
0N/ATableExample4:
0N/A Uses specialized renderers and editors.
0N/A
0N/ATableExample3 and TableExample4 do not depend on database connectivity
0N/Aand can be compiled and run in the normal way.
0N/A
0N/AThe most interesting example is probably TableExample, which has a
0N/ATextArea that can be used as an editor for an SQL expression. Pressing
0N/Athe Fetch button sends the expression to the database. The results are
0N/Adisplayed in the JTable underneath the text area.
0N/A
0N/ATo run TableExample and TableExample2, you need to find a driver for
0N/Ayour database and set the environment variable JDBCHOME to a directory
0N/Awhere the driver is installed. See the following URL for a list of
0N/AJDBC drivers provided by third party vendors:
0N/A
0N/A http://java.sun.com/products/jdbc/drivers.html
0N/A
0N/AOnce you find the driver, you can run one of the database examples by
0N/Aspecifying a class path that includes the JDBC classes and the example
0N/Aclasses.
0N/A
0N/AFor example:
0N/A
0N/A java -classpath $(JDBCHOME):TableExample.jar TableExample
0N/A
0N/AThese instructions assume that this installation's version of the java
0N/Acommand is in your path. If it isn't, then you should either
0N/Aspecify the complete path to the java command or update your
0N/APATH environment variable as described in the installation
0N/Ainstructions for the Java(TM) SE Development Kit.
0N/A