Browsing result set in gui
how do i browse resulr set one by one
i try to do
but it place me in last row
stat = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
res = stat.executeQuery("Select * from netTable");
while(res.next())
l1.setText(res.getString(1));
l2.setText(res.getString(2));
}stat Statement instance,res ResultSet Instance,l1,l2 labels
Karamjeet, my East Midlands friend, I don't think you want to display each row, 'one by one'. Rather I think you meant to say that you want to display the result set in tabular form. Whether you choose to use a JTable, an HTML table, or a piece of paper on the dining room table is up to you but my esteemed colleague georgemc is correct. Don't use that loop!
Jai Hind.
Similar Messages
-
How to export result set from mysql query browser to .sql in oracle
Hi folks:
I was trying to export result set from MySql query browser to Oracle. I could able to do
File->Export Result Set-> Excel format...
What I am trying to get is .sql file so that I can run it as a script in my oracle db. Is there any way we can get .sql file with inserts and delimeters ....?
Did you guys get my question.?
Please throw some light on this....
Could be very appreciable ....
Thanks
Sudhir NaiduHi
Create a sql statement which generates the insert statements.
Something like this:
select 'insert into table1 (column1, column2, column3) values (' ||
column1 || ', ' || column2 || ', ' || column3 || ');' from table 1;
The || sign is the string concatenation sign in Oracle, replace it the appropriate sign in MySql. Export the result set of this query into a file, and you can run it in a SqlPlus.
Ott Karesz
http://www.trendo-kft.hu -
We have a GUI swing screen in which we have navigation buttons.
when the user clicks the previous ,next, last,first buttons we have to show the records accordingly.
The min. size of the database is around 1 million.and each row has 60 columns.
Our approach is screen--->servlet-->ejb beans --->database.
since the database is huge how to hold the values, and where, without affecting the performance.
If we get the resultset it holds all the data.since the data size is huge,we are looking for a solution.The user may browse through the data ,edit the data and delete the data.
we have to perform accordingly. Also, if, for example, user1 is seeing record no.1 & user 2 has modified record no.3 in the meanwhile, when user1 goes to record no.3, he should see the
modified record. In short, the user should always see the latest values.
please give us the best approach to solve this problem.
Also this is in a multi user environment.It seems like you need to look at threads to update current values in the display and narrow the result set that you retrieve to match the criteria needed for display. You might consider making the method to change values a syncronized one.
-
Result set does not fit; it contains too many rows
Dear All,
We are in BI7 and running reports on Excel 2007. Even though number of rows limitation in Excel 2007 is more than 1Million, when I try to execute a report with more than 65k records of output, system is generating output only for 65k rows with message "Result set does not fit; it contains too many rows".
Our Patch levels:
GUI - 7.10
Patch level is 11
Is there any way to generate more than 65000 rows in Bex?
Thanks in advance...
regards,
Raju
Dear Gurus,
Could you please shed some light on this issue?
thanks and regards,
Raju
Edited by: VaraPrasadraju Potturi on Apr 14, 2009 3:13 AMVara Prasad,
This has been discussed on the forums - for reasons of backward compatibility I do not think BEx supports more that 65000 rows .... I am still not sure about the same since I have not tried out a query with more that 65K rows on excel 2007 but I think this is not possible... -
Hi all,
At the moment we have some java classes (not ejb - cmp/bmp) for search in
our ejb application.
Now we have a problem i.e. records have grown too high( millions ) and
sometimes query results in retrieval of millions of records. It results in
too much memory consumtion in our ejb application. What is the best way to
address this issue.
Any help will be highly appreciated.
Thanks & regards,
Parvezyou can think of following options
1) paging: read only few thousands at a time and maintain a index to page
through complete dataset
2) caching!
a) you can create a serialized data file in server to cache the result set
and can use that to browse through. you may do on the fly
compression/uncompression while sending data to client.
b) applet based solution where caching could be in client side. Look in
http://www.sitraka.com/software/jclass/cs_ims.html
thanks,
Srinivas
"chauhan" <[email protected]> wrote in message
news:[email protected]...
Thanks Slava Imeshev,
We already have search criteria and a limit. When records exceeds thatlimit
then we prompt user that it may take sometime, do you want to proceed? If
he clicks yes then we retrieve those records. This results in lot ofmemory
consumtion.
I was thinking if there is some way that from database I can retrieve some
block of records at a time rather the all records of a query. I wander how
internet search sites work, where thousnds of sites/pages match criteriaand
client can move back & front on any page.
Regards,
Parvez
"Slava Imeshev" <[email protected]> wrote in message
news:[email protected]...
Hi chauhan,
You may want to narrow search criteria along with processing a
limited number of resulting records. I.e. if the size of the result
is bigger than a limit, you stop fetching results and notify the client
that search criteria should be narrowed.
HTH.
Regards,
Slava Imeshev
"chauhan" <[email protected]> wrote in message
news:[email protected]...
Hi all,
At the moment we have some java classes (not ejb - cmp/bmp) for
search
in
our ejb application.
Now we have a problem i.e. records have grown too high( millions ) and
sometimes query results in retrieval of millions of records. It
results
in
too much memory consumtion in our ejb application. What is the best
way
to
address this issue.
Any help will be highly appreciated.
Thanks & regards,
Parvez -
SQL query with parameter returns empty result set, please help !!!
Hi there,
When I use the following query :
<sql:query var="beroepsthemas" >
select *
from beroepsthemas
where beroepsthemaid = ?
<sql:param value="12"/>
</sql:query>
When I want to browse the result set with :
<c:forEach items="${beroepsthemas.rows}" var="rij">
it shows no records. But it must return at least one.
All my jsp pages with sql queries and parameters have the same problem.
This is all on my test environment. I'm using Ubuntu 5.10, Netbeans5.0, JDK 1.5_06, application runs in Bundeled Tomcat 5.5.9, MySQL 4.1.12, mysql-connector3.1.6
When the same code is run on the live environment, it works just fine.
The difference is :
Mysql 4.1.10a, tomcat5.5.9, mysql-connector3.1.6
What can there be wrong !!When the same code is run on the live environment, it
works just fine.
The difference is :
Mysql 4.1.10a, tomcat5.5.9, mysql-connector3.1.6
I didn't catch this. I think you may need to update the database driver. -
How can I use a Lookup task to lookup from my SQL Result set and have a join
So in my Control Flow, I have an Execute SQL Task which gets my Table result set. I then have a Foreach Loop Container that iterates through the result set and a Data Flow. The first task in the Data Flow is an OLE DB Source SQL Command that retrieves data
columns associated with my result set. I then do a Derived Column so I can SUBSTRING from one of my data columns and now I want to perform a Lookup to my Application Database.
How do I code my Lookup task to utilize my SQL Result set variable and match on it? I cannot use the GUI for the Lookup task as my Lookup has to have some JOINS in it.
Thanks for your review and am hopeful for a reply.Can you expand on that? I'm sorry but I am new and a novice to the SSIS world and I want to do this as best I can and as efficiently as I can. Are you saying that Rajen's way suggested above is the way to go?
A little background....external data from a 3rd party client. I'v staged that external data to a SQL Server staging table. I have to try and match that data up to our database using SSN, DOB, and Gender...and if I can't match that way then I have to try
and match by Name. I need to make sure that there is only one and only one account for that match. If I cannot match and match one and only one, then I'll create rows on a DataAnomaly Table. If I do match, then I have to check and make sure that there is only
one and only one Member span for that match. Similarly handle the data anomaly and then check and make sure there is a "Diabetes" claim and similarly handle the DataAnomaly accordingly.
That's where I'm at. Sooooo are you saying to use Rajen's suggestion? I don't think I can do that because I need multiple SQL tasks and I cannot connect multiple OLE DB Source tasks.
Any help and suggestions are greatly appreciated.
Thanks. -
Need help in restricting a result set from a UNION in MERGE
Hello,
Would really appreciate if anybody could help me out with the issue I am facing with the below statements (I am new to Oracle ):
merge into table_name_1 p
using
select p_key, value_1, value_2
from some_tables
UNION
select p_key, value_1, value_2
from some_tables
UNION
)t
on (p.p_key = t.p_key)
when matched then
update table_name_1 with value_1 and value_2
when not matched then
insert table_name_1 with p_key, value_1, value_2;
Now, the union of all those selects gives me distinct values and it works most of the times but when I get values like below, the merge fails:
p_key-----value_1-----value_2
100-----25-----50
100-----NULL-----50
I browsed the net and understood the reason behind this: the result set becomes ambiguous and merge doesn't know which row to insert first and which one to update.
Now, my requirement is: I could have any of the below scenario/result sets from the union and I need only 1 row per p_key -
result_set_1
p_key-----value_1-----value_2
100-----25-----50 ***************need this row
100-----NULL-----50
100-----NULL-----NULL
result_set_2
p_key-----value_1-----value_2
100-----25-----NULL ***************need this row
100-----NULL-----NULL
result_set_3
p_key-----value_1-----value_2
100-----25-----NULL ***************need this row (p_key = 100)
100-----NULL-----NULL
200-----NULL-----75 ***************need this row (p_key = 200)
200-----NULL-----NULL
300-----90-----95 ***************need this row (p_key = 300)
So, I basically need a way to restrict the values that I will get from the UNION of all those selects to fit the requirement above, hope I was able to explain the issue I am facing.
Any help would be greatly appreciated.
Thanks,
DpunkIn all cases the goal is to find an order by value that will make the row you want be first.
The query I gave is calculating a priority for each row by adding up values showing whether each column is null or not null. The case statements check whether each column is null and need to be added up to give a total priority value.
Value_1 Value_2 Priority
Not Null Not Null 2 + 1 = 3
Not Null Null 2 + 0 = 2
Null Not Null 0 + 1 = 1
Null Null 0 + 0 = 0
The priority value ends up being a bitmap showing whether each value is null or not null. I think that reflects my mathematics background.
Another way of getting the same result (suggested to me by your asking why it needs the "+") would be to use two CASE expressions as separate order by items:
select p_key, value_1, value_2 from
(select p_key, value_1, value_2, row_number() over
(partition by p_key
order by case when value_1 is null then 0 else 1 end DESC,
case when value_2 is null then 0 else 1 end DESC
) as rn
from (your UNION query here)
where rn = 1
A third way is to use a more complex case statement:
select p_key, value_1, value_2 from
(select p_key, value_1, value_2, row_number() over
(partition by p_key
order by case when value_1 is NOT null and value_2 is NOT null then 1
when value_1 is NOT null and value_2 is null then 2
when value_1 is null and value_2 is NOT null then 3
when value_1 is null and value_2 is null then 4
end ASC
) as rn
from (your UNION query here)
where rn = 1 -
Just in time creation of Result Set
I have this problem which is bugging me a lot. Actually I want to display some data on the browser by fetching it from the database. Now this result set could be quite big. So i would like to display on multiple pages like if there are 100 rows then 25 rows per page, so in total 4 pages. One way to do this load all data in memory and then display it moving your cursor down, but in this technique u have to keep large amount of data in memory. I want to fetch these rows as required like first time top 25 rows, next time next 25 rows and so on. I am stuck.. Please help me!!
//you could use a Select bean:
private com.ibm.ivj.db.uibeans.Select getSelectSQL() {
if (ivjSelectSQL == null) {
try {
ivjSelectSQL = new com.ibm.ivj.db.uibeans.Select();
ivjSelectSQL.setReadOnly(true);
ivjSelectSQL.setQuery(new com.ibm.ivj.db.uibeans.Query ivjSelectSQL.setQuery(new com.ibm.ivj.db.uibeans.Query(getMyCon(), sqlGeneral()));
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
return ivjSelectSQL;
ivjScrollPaneTableGen.setModel(getSelectSQL());
ivjScrollPaneTableGen.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
ivjScrollPaneTableGen.setAutoCreateColumnsFromModel(true);
getSelectSQL().execute();
// after this your table will contain automatically all the rows.
how the NextPage should work I haven't done yet, but I saw there is a setViewport(JViewport) function in JScrollPane class which seems to do the thing that you want. -
SQLException after end of result set
hi guys.
im in a lot of bother at the moment.
i have a GUI with a database in mysql. my gui is a recommender system and so users need to log in etc...
i know for certain that the gui does connect to the database because when a new user enters there details it does get updated in the database.
my problem is that when the user tries to gain acces to the system by going to the 'current user' and entering there details nothing happens.
i am finding it very difficult to find out what the problem is, i have been trying for over a week but no luck and im hoping somebody will know how to help me.
please could somebody help me here, i have a very short time aswell. monday.
here is my code below.
thank-you very much for your help
its not normal to post the whole class here but im really really stumped.
the errors that appears in the dos window is SQLException After end of result set.
* Function: This class is used for loggin in. It looks for the user name and password *
* the user enters in the database. If there is no match an error message will appear *
* to the user. If there is a match the system logs the user in and dispalys the chose *
* topic page *
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import com.mysql.jdbc.Driver;
import java.sql.*;
import java.awt.BorderLayout;
import java.io.IOException;
public class CurrentUserFrame extends JPanel implements ActionListener {
// private is used so object variables cannot be changes by another class.
private JButton loginButton = null ;
private JTextField userName = null ;
private JTextField password = null ;
private JLabel userLabel = null ;
private JLabel passwordLabel = null ;
Boolean loginSuccess ;
private JPanel cardPanel = null ;
public CardLayout cardLayout = null ;
protected static com.mysql.jdbc.Driver mysqlDriver = null;
String passwordDbase ;
String usernameDbase ;
private CardLayout getCardLayout () {
if (cardLayout == null ) {
cardLayout = new CardLayout () ;
return cardLayout ;
private JPanel getCardPanel () {
if (cardPanel == null) {
cardPanel = new JPanel () ;
return cardPanel ;
// creates the background colours for the panels by specifying the amounts of red
// green, blue where 0.5F is the least amount and 1.0F is the most
Color currentTitleColor = new Color (0.58F, 0.73F, 0.83F) ;
Color currentMainPanelColor = new Color (0.980F, 0.973F, 0.843F) ;
public CurrentUserFrame ()
setLayout (new BorderLayout ()) ;
JPanel mainCPnl = new JPanel () ;
mainCPnl.setLayout (new BorderLayout ()) ;
JPanel mainPanel = new JPanel () ;
// maindisplaypanel will be set with a borderlayout
mainPanel.setLayout (new BorderLayout ());
JPanel descriptionPanel = new JPanel ();
descriptionPanel.setLayout(new BorderLayout ());
// creates a textarea for the title and description
JTextArea description2 = new JTextArea ("\t\tCurrent User Page\n\n" +
"Please enter your user name and password to login.\n\n" +
"If you have forgotten your user name or password click on " +
" 'FORGOT PASSWORD'.") ;
// stops the text area being edited by the user
description2.setEditable (false) ;
// once the text in description reaches the end of the textarea it will start a new line
description2.setLineWrap (true) ;
//sets the background colour of the textarea
description2.setBackground (currentTitleColor) ;
//sets the type of font with its size for the description textarea
description2.setFont (new Font ("TimesRoman", Font.BOLD, 16)) ;
// the descriptionpanel will be placed in the mainpanel at the top.
mainPanel.add (descriptionPanel, BorderLayout.NORTH) ;
descriptionPanel.add(description2, BorderLayout. NORTH) ;
JPanel currentUserPanel = new JPanel () ;
currentUserPanel.setLayout (new BoxLayout (currentUserPanel, BoxLayout.Y_AXIS)) ;
// creates a button with an actionlistener so t can carryout a task when it is pressed.
// the settooltiptext () method displays a message when the user hovers over the button with the curser
loginButton = new JButton ("Log In") ;
loginButton.addActionListener(this) ;
loginButton.setToolTipText ("Logs you into the system") ;
// creates a text field which is 25 characters in length for the user to enter their name
userName = new JTextField (25) ;
// creates a text field which is 15 characters in length for the user to enter their password
password = new JPasswordField (15) ;
userLabel = new JLabel ("User Name") ;
passwordLabel = new JLabel ("Password") ;
//adds the text fields and the JLabels to the currentuserPanel
currentUserPanel.add (userLabel) ;
currentUserPanel.add (userName) ;
currentUserPanel.add (passwordLabel) ;
currentUserPanel.add (password) ;
currentUserPanel.add (loginButton) ;
JPanel loginPanel = new JPanel () ;
loginPanel.setLayout (new FlowLayout (FlowLayout.CENTER, 0, 170)) ;
loginPanel.setBackground (currentMainPanelColor) ;
loginPanel.add (currentUserPanel, BorderLayout.CENTER) ;
mainPanel.add (loginPanel, BorderLayout.CENTER) ;
JPanel chooseTopicCard = new JPanel () ;
chooseTopicCard.setLayout (new GridLayout (0, 1, 0, 10)) ;
ChooseTopic frame8 = new ChooseTopic () ;
frame8.setVisible (true) ;
chooseTopicCard.add(frame8) ;
// this will create the panel for the maincontent area and sets the layout
JPanel cp = getCardPanel();
cp.setLayout(getCardLayout());
cp.add("card3",mainPanel) ;
cp.add("card7", chooseTopicCard) ;
cardLayout.show (getCardPanel () , "card3") ;
// this adds the cardlayout to the main panel and then adds the mainpanel screen
mainCPnl.add(cp) ;
this.add (mainCPnl) ;
public void actionPerformed (ActionEvent event) {
Object source = event.getSource () ;
if (source == loginButton) {
// creates a string to connect to the local host and database
// the following 10 lines of code is from the mysql website
String url = "jdbc:mysql://:3306/project" ;
Connection con = null ;
// com.mysql.jdbc.Driver is a folder downloaded from mysql website
try {
mysqlDriver = (com.mysql.jdbc.Driver) Class.forName ("com.mysql.jdbc.Driver").newInstance () ;
} catch ( Exception E) {
throw new RuntimeException ("Can not load driver class com.mysql.jdbc.Driver") ;
try {
// attempts a connection with the computer
// root is used as a default so i can have full access to the database
con = DriverManager.getConnection (url,"root","") ;
// trys to log in to the database
// statement is a mysql class
Statement select = con.createStatement ();
ResultSet result = select.executeQuery ("select * from user_login") ;
String userNameText = userName.getText();
String passwordText = password.getText();
if (userNameText.equals("") || passwordText.equals("")) {
JOptionPane okoptionpane = new JOptionPane () ;
okoptionpane.showMessageDialog(null, "You have entered your username or password incorrectly, please try again") ;
while ((result.next()) && (result != null))
//String usernameval ;
//String passwordval ;
passwordDbase = result.getString("password");
usernameDbase = result.getString("user_name");
//passwordDbase = "password";
//usernameDbase = "user_name";
if ((passwordDbase.equals(passwordText)) && (usernameDbase.equals(userNameText))) {
cardLayout.show(getCardPanel(), "Card7");
catch (Exception e) {
e.printStackTrace() ;
finally {
if (con != null ) {
try {con.close () ; }
catch (Exception e) {
e.printStackTrace () ;
LIZooppps, very sorry, you can guess im new to this forum. sorry again. i thought maybe the whole code was needed.
i have posted all the output from the dos window.
java.sql.SQLException: After end of result set
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java:3628)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:1763)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:1827)
" at CurrentUserFrame.actionPerformed(CurrentUserFrame.java:214) "
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknow
n Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
i think it is mainly line that is in speach marks. line 214.
the error that comes up says." after end of result set "
thank-you
and sorry once again, im in a bit of a panic,
Liz -
Hi All,
I am using Oracle 11g and I am trying to delete some records from database using some GUI. In that case I am getting following error:
java.lang.Exception: org.hibernate.AssertionFailure: scrollable result sets are not enabled. When I restart the application's service, this error is going away and deletion is working fine.
Other related jars that I am using is as follow:
ojdbc5.jar
hibernate-3.0.5.jar
I am attaching the stack trace as well:
<log4j:event logger="org.hibernate.AssertionFailure" timestamp="1263964931355" sequenceNumber="24" level="ERROR" thread="SocketListener0-2">
<log4j:message><![CDATA[an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)]]></log4j:message>
<log4j:throwable><![CDATA[org.hibernate.AssertionFailure: scrollable result sets are not enabled
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:334)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)
at org.hibernate.loader.Loader.scroll(Loader.java:1634)
at org.hibernate.loader.hql.QueryLoader.scroll(QueryLoader.java:443)
at org.hibernate.hql.ast.QueryTranslatorImpl.scroll(QueryTranslatorImpl.java:291)
at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:960)
at org.hibernate.impl.QueryImpl.scroll(QueryImpl.java:62)
at com.sample.persistence.WorklistItemDAO.purge(WorklistItemDAO.java:145)
at com.sample.server.worklistmanager.WorklistManager.purge(WorklistManager.java:695)
at com.sample.server.webservices.CCGPIWorklistHandler.purge(CCGPIWorklistHandler.java:329)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.xmlrpc.Invoker.execute(Invoker.java:130)
at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:84)
at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:146)
at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139)
at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:114)
at com.sample.server.webservices.XmlRpcServlet.service(XmlRpcServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:666)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
]]></log4j:throwable>
</log4j:event>
Thanks
ShivHi All,
anybody got a chance to look into it?
--Shiv -
Please help - Scrollable result set in sql server 2000
Hi can some one please help me. I'm trying to create scrollable result set in sql server 2000, but i just can't get it to work. I've been trying to do this for the past 12 hours. I want to go home, but I can't till I get this going! please help!!! My crap code is as follows:
package transact;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.JInternalFrame;
import java.sql.*;
import java.io.*;
import java.util.*;
public class DummyFrame extends Dummy
protected String name, surname;
protected Connection conn;
protected CallableStatement cstatement;
public DummyFrame()
createFrame();
private void createFrame()
try
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
conn = DriverManager.getConnection(
"jdbc:microsoft:sqlserver://server:1433;" +
"user=user;password=pwd;DatabaseName=Northwind");
catch (Exception e)
e.getMessage();
populateFields();
menuAction();
show();
private void menuAction()
btncontacts.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
getRecords();
populateFields();
btncontacts.setText("NEXT");
btnkeywords.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
// transaction.getRecords();
nextRecord();
populateFields();
btncontacts.setText("NEXT");
protected void nextRecord()
try
// CallableStatement cstatement = null;
cstatement = conn.prepareCall(
"{call Employee_Selection}", ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = cstatement.executeQuery();
while (rs.next())
surname = rs.getString("Lastname");
cstatement.getMoreResults();
catch (Exception e)
e.getMessage();
protected void getRecords()
try
CallableStatement cstatement = null;
cstatement = conn.prepareCall(
"{call Employee_Selection}", ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = cstatement.executeQuery();
while (rs.next())
surname = rs.getString("Lastname");
name = rs.getString("Firstname");
rs.first();
// call stored procedure
catch (Exception e)
e.getMessage();
// populate the fields;
private void populateFields()
txtfirstname.setText(name);
txtsurname.setText(surname);
}ummm ok i think the logic in your code is kinda screwy...
here is what your should be doing.
create the gui.
get the resultset...
have code that looks like this for nextRecord...
protected void displayNextRecord(){
// we do not call next here because we already called it last time
surname = rs.getString("Lastname");
name = rs.getString("Firstname");
populateFields();
if(!rs.next(){
btncontacts.setEnabled(false);// i'm not sure what btncontacts is but we want to disable next becuase there are no more records...
// in your intitalization code you need to do this...
// you old stuff ending with...
ResultSet rs = cstatement.executeQuery();
// the new stuff...
if(rs.first()){
displayNextRecord();
}else{
btncontacts.setEnabled(false);//the result set is empty
}ok the real problem you are having is that you are trying to display one record at a time but you are scrolling
through the entire result set using while(rs.next()... what you
want to do is create the result set once and scroll through
it one item at a time with your gui.
the example method i have given displays the data from the current
row in your gui. then it advances the result set forward one row if possible. this method assumes that the result set will always
be positioned on a valid row thus the need for calling
rs.first() before we originally call displayNextRecord()
well i hope you find this helpful. -
How to modify the search results of the GUI for subscribing to calendars
How to modify the search results of the GUI for subscribing to calendars
Note:
<OL>
<LI>The following information applies only to iPlanet Calendar Server 5.0
Patch 3.
<LI>All of the cases for which the XSLT changes will work have not been
verified.
<LI>The following is only an example of an XSLT customization.
</OL>
The example below shows a sample customization of the
search_for_calendars
dialog. This customization will result in the Display Name being included as
part of the search results in the GUI, which would normally show just the
calendar ID. It will render the returned calendars in the following format:
<P>
Display Name - <I>description</I>
<P>
Normally, the format would be as follows:
<P>
Calendar-ID - <I>description</I>
<P>
</A>
The example consists of the following two files:
<P>
<OL>
<LI>search_for_calendars_common.xsl
(the entire XSLT file)
<P>
<LI>diffctx.txt
(the context sensitive diff patch file,
which basically shows only the changes that need to be made)
</OL>
<P>
<HR>
</A><B>
search_for_calendars_common.xsl</B>
<?xml version="1.0" ?>
<!DOCTYPE xsl:stylesheet (View Source for full doctype...)>
- <!--
set the output properties
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
result-ns="http://www.w3.org/TR/REC-html40">
-->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
- <!-- set the output properties
-->
<xsl:output method="html" encoding="ISO-8859-1" />
<xsl:include href="data/common.xsl" />
<xsl:include href="data/i18n.xsl" />
<xsl:include href="data/date_format.xsl" />
<xsl:include href="data/dialog_tabs.xsl" />
- <xsl:template match="/">
<xsl:apply-templates select="calendar" />
</xsl:template>
- <xsl:template match="calendar">
- <xsl:choose>
- <xsl:when test="@top='true'">
- <xsl:variable name="Frame1">
<xsl:value-of select="frame[1]" />
</xsl:variable>
- <xsl:variable name="Frame2">
<xsl:value-of select="frame[2]" />
</xsl:variable>
- <xsl:variable name="Frame3">
<xsl:value-of select="frame[3]" />
</xsl:variable>
- <xsl:variable name="tab_value">
<xsl:value-of select="@tab" />
</xsl:variable>
- <HTML>
- <HEAD>
<xsl:call-template name="contextJavascript" />
<TITLE>Calendars Search: Calendar Express - iPlanet</TITLE>
</HEAD>
- <FRAMESET border="0" frameborder="0" rows="77,*,71">
<FRAME name="tab" marginheight="0" marginwidth="0" scrolling="no"
scrollbars="no" src="{$Frame1}" />
<FRAME name="main" frameborder="0" src="{$Frame2}" />
<FRAME name="button" marginheight="0" marginwidth="0" scrolling="no"
scrollbars="no" frameborder="0" src="{$Frame3}" />
</FRAMESET>
</HTML>
</xsl:when>
- <xsl:when test="@view='searchProperties'">
- <xsl:for-each select="group">
- <xsl:if test="@name='searchProperties'">
<xsl:call-template name="search_toolbar" />
</xsl:if>
</xsl:for-each>
</xsl:when>
- <xsl:when test="@view='main'">
- <xsl:for-each select="group">
- <xsl:if test="@name='main'">
<xsl:call-template name="main" />
</xsl:if>
</xsl:for-each>
</xsl:when>
- <xsl:when test="@view='button'">
- <xsl:for-each select="group">
- <xsl:if test="@name='button'">
<xsl:call-template name="button_root" />
</xsl:if>
</xsl:for-each>
</xsl:when>
- <xsl:otherwise>
- <html>
What's this view? (search_for_cals.xsl) -
<xsl:value-of select="@view" />
</html>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
- <xsl:template name="search_toolbar">
- <HTML>
<xsl:call-template name="emit_frame_head_tag" />
- <BODY bgcolor="{$bgcolor_background}" background="imx/tdbg.gif"
marginwidth="0" marginheight="0" onload="window.focus()">
- <FORM>
- <xsl:attribute name="action">
<xsl:value-of select="./formdata@action" />
</xsl:attribute>
<xsl:attribute name="name">form</xsl:attribute>
<xsl:attribute name="onSubmit">document.forms[0]['find'].click(); return false;
</xsl:attribute>
<xsl:apply-templates select="formdata" />
- <CENTER>
- <TABLE border="0" cellpadding="2" cellspacing="0" width="100%" height="100%">
- <TR>
- <TD align="center">
- <TABLE border="0" cellpadding="3" cellspacing="1">
- <TR>
- <TD colspan="4">
<FONT size="{$font_size_big_2}" face="{$font_name}">Find all calendars where
the calendar</FONT>
</TD>
</TR>
- <TR>
- <TD valign="baseline">
- <FONT size="{$font_size_big_2}" face="{$font_name}">
- <SELECT name="which">
<OPTION value="name;calid">name or ID</OPTION>
<OPTION value="name">name</OPTION>
<OPTION value="primaryOwner">primary owner</OPTION>
<OPTION value="calid">ID</OPTION>
</SELECT>
</FONT>
</TD>
- <TD valign="baseline">
- <FONT size="{$font_size_big_2}" face="{$font_name}">
- <SELECT name="how">
<OPTION value="0">contains</OPTION>
<OPTION value="1">begins with</OPTION>
</SELECT>
</FONT>
</TD>
- <TD valign="baseline">
<INPUT type="text" name="what" />
</TD>
- <TD valign="baseline">
- <FONT size="{$font_size_big_2}" face="{$font_name}">
- <INPUT type="button" name="find" value="Find">
- <xsl:attribute name="onClick">
<xsl:value-of select="./button[@name='find']" />
</xsl:attribute>
</INPUT>
</FONT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</CENTER>
</FORM>
</BODY>
</HTML>
</xsl:template>
- <xsl:template name="main">
- <HTML>
<xsl:call-template name="emit_frame_head_tag" />
- <BODY bgcolor="{$bgcolor_background}" background="imx/tdbg.gif"
marginwidth="0" marginheight="0">
- <FORM name="form" method="post">
- <xsl:attribute name="action">
<xsl:value-of select="./formdata@action" />
</xsl:attribute>
<xsl:attribute name="name">form</xsl:attribute>
<xsl:apply-templates select="formdata" />
<INPUT type="hidden" name="how" value="0" />
<INPUT type="hidden" name="which" value="name;calid" />
<INPUT type="hidden" name="what" value=" />
<INPUT type="hidden" name="selectedGroup" />
- <xsl:if test="(./calsearchresults/nomatch)">
- <!-- print no match found
-->
&nbsp;
&nbsp;
No Match Found
</xsl:if>
- <xsl:for-each select="./calsearchresults/searchresultcal">
- <P>
&nbsp;
&nbsp;
- <FONT size="{$font_size_big_2}" face="{$font_name}">
- <FONT size="{$font_size_big}" face="{$font_name}">
Owner:
<xsl:value-of select="@owner" />
<FONT size="{$font_size_big}" face="{$font_name}" color="{$bgcolor_wend_mid}">|
</FONT>
Calendar ID:
<xsl:value-of select="@id" />
<BR />
</FONT>
- <FONT size="{$font_size_big_2}" face="{$font_name}">
- <xsl:choose>
- <xsl:when test="@subscribed='false'">
&nbsp;
&nbsp;
- <INPUT type="checkbox" name="calendar">
- <xsl:attribute name="value">
<xsl:value-of select="@name" />
</xsl:attribute>
</INPUT>
&nbsp;
&nbsp;
- <A target="_blank">
- <xsl:attribute name="href">
<xsl:value-of select="@viewCommand" />
</xsl:attribute>
<xsl:value-of select="@name" />
</A>
</xsl:when>
- <xsl:otherwise>
&nbsp;
&nbsp;
- <A target="_blank">
- <xsl:attribute name="href">
<xsl:value-of select="@viewCommand" />
</xsl:attribute>
<xsl:value-of select="@name" />
</A>
&nbsp;
(Subscribed)
</xsl:otherwise>
</xsl:choose>
- <xsl:if test="string-length(@description) > 0">
&nbsp;
&nbsp;
- <FONT size="{$font_size_big}" face="{$font_name}">
<xsl:value-of select="@description" />
</FONT>
</xsl:if>
</FONT>
</FONT>
</P>
</xsl:for-each>
</FORM>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
<P>
<A HREF="#back">Back</A>
<P>
<HR>
</A>
<B>diffctx.txt</B>
Index: search_for_calendars_common.xsl
===================================================================
RCS file: /m/src/ns/server/msg/calendar/core/html/search_for_calendars_common.xsl,v
retrieving revision 1.1.2.14
diff -c -r1.1.2.14 search_for_calendars_common.xsl
*** search_for_calendars_common.xsl 2000/12/12 23:10:43 1.1.2.14
--- search_for_calendars_common.xsl 2001/03/15 23:55:19
*** 182,188 ****
&nbsp; &nbsp;
<INPUT type="checkbox" name="calendar">
<xsl:attribute name="value">
! <xsl:value-of select="@id"/>
</xsl:attribute>
</INPUT>
&nbsp; &nbsp;
--- 182,188 ----
&nbsp; &nbsp;
<INPUT type="checkbox" name="calendar">
<xsl:attribute name="value">
! <xsl:value-of select="@name"/>
</xsl:attribute>
</INPUT>
&nbsp; &nbsp;
*** 190,196 ****
<xsl:attribute name="href">
<xsl:value-of select="@viewCommand"/>
</xsl:attribute>
! <xsl:value-of select="@id"/>
</A>
</xsl:when>
<xsl:otherwise>
--- 190,196 ----
<xsl:attribute name="href">
<xsl:value-of select="@viewCommand"/>
</xsl:attribute>
! <xsl:value-of select="@name"/>
</A>
</xsl:when>
<xsl:otherwise>
*** 199,205 ****
<xsl:attribute name="href">
<xsl:value-of select="@viewCommand"/>
</xsl:attribute>
! <xsl:value-of select="@id"/>
</A>
&nbsp;(Subscribed)
</xsl:otherwise>
--- 199,205 ----
<xsl:attribute name="href">
<xsl:value-of select="@viewCommand"/>
</xsl:attribute>
! <xsl:value-of select="@name"/>
</A>
&nbsp;(Subscribed)
</xsl:otherwise>
<P>
<A HREF="#back">Back</A>Maybe on the Google API s page?
-
Result Set fetch agonisingly slow
I am having sporadic trouble retrieving data from a ResultSet. I do not know how to tell if it is an Oracle problem or a JDBC problem.
In a while( results.next() ) loop, for some result sets it pauses for several seconds after every 10 iterations. This usually causes a webserver time-out and the results never get to the browser. It is NOT volume related, as some LARGER result sets from almost identical queries (i.e. with just one value in the where clause changed) run fine. We are using Oracle 8i, and the "problem" query always runs fine in SQLPlus (i.e. less than ten seconds for the execution and display of ~700 rows).
some relevant evidence:
a) Usually the PreparedStatement.execute() itself is pretty quick - just a few seconds at worst
b) All result sets from this query pause every 10 iterations, but most pause for just a fraction of a second
c) With a certain value in the where clause, the pauses are 4-30 seconds, which, even when only ~700 rows are returned, results in a response time of several minutes.
d) The pauses are in the results.next() statement itself (I have output timestamps at the very beginning and the very end of the loop to show this).
e) the query is a join of six tables
f) the part of the where clause that changes is: AND FULFILLER.NAME IN (...) , where the IN clause can contain single or multiple names (but I am using a single value in the "problem" query)
g) The FULFILLER.NAME column IS an indexed field, and that index IS being used (according to "EXPLAIN PLAN") in both the fast queries and the slow queries.
What confuses me (amongst several things) is this: I would have thought that the values in the where clause would only affect the creation of the ResultSet, and not the reading of that result set. Am I wrong? Any ideas anyone?
Thanks,
Martin Reynolds (renozu)I am having sporadic trouble retrieving data from a
ResultSet. I do not know how to tell if it is an
Oracle problem or a JDBC problem.
In a while( results.next() ) loop, for some
result sets it pauses for several seconds after every
10 iterations. This usually causes a webserver
time-out and the results never get to the browser. It
is NOT volume related, as some LARGER result sets from
almost identical queries (i.e. with just one value in
the where clause changed) run fine. We are using
Oracle 8i, and the "problem" query always runs fine in
SQLPlus (i.e. less than ten seconds for the execution
and display of ~700 rows).
some relevant evidence:
a) Usually the PreparedStatement.execute() itself is
pretty quick - just a few seconds at worst
b) All result sets from this query pause every
10 iterations, but most pause for just a fraction of a
second
c) With a certain value in the where clause, the
pauses are 4-30 seconds, which, even when only ~700
rows are returned, results in a response time of
several minutes.
d) The pauses are in the results.next() statement
itself (I have output timestamps at the very beginning
and the very end of the loop to show this).
e) the query is a join of six tables
f) the part of the where clause that changes is:
AND FULFILLER.NAME IN (...) , where the IN
clause can contain single or multiple names (but I am
using a single value in the "problem" query)
g) The FULFILLER.NAME column IS an indexed field, and
that index IS being used (according to "EXPLAIN PLAN")
in both the fast queries and the slow queries.
What confuses me (amongst several things) is this: I
would have thought that the values in the where clause
would only affect the creation of the
ResultSet, and not the reading of that result
set. Am I wrong? Any ideas anyone?
this honestly doesn't HAVE to be the case... depending on the cursor.
i think if one has a forward only cursor the database could figure it out as it scans along the table. it should be fater in fact because if it does like this you only do one table scan and not two. this theory seems to fall apart when you say it is using the index BUT if I was writing a database and you had a forward only cursor AND the distribution of keys in the index indicated that there were many rows that would match your query I might ignore the index and do it as described.
so call me crazy but here is my suggestion...
if the cursor you are using is a forward only cursor then try a scrollable cursor.
if it is already a scrollable cursor or changing it didn't help then try this...
rs.last();
rs.beforeFirst();
// now process normally using next()i would think that this would force the database to find all the rows.... so it should help.
also the server timeout issue will sort of need to be addressed also if the query still takes a long time to run...
Thanks,
Martin Reynolds (renozu) -
Button panel replaced by JTable result set
Hi guys. Here's the problem. Below is my current working code.
When run - a JOption pane opens, into which I type the database location (using /'s instead of \'s as it is a String input).
The main UI opens. That indicates that the connection was successful. The UI consists of a JPanel (north) containg a number of buttons. Below that is a space for a JTable. Each button represents a diiferent query to the database and a different result set is displayed in the JTable beneath the buttons depending on which button is clicked.
This all works fine.
However I would like to now modify the code so that when the program runs the user is faced with the JPanel containing the Buttons only. And when a button is clicked the current panel is replaced with a full JTable containing the result set.
So basically I want a JPanel with a number of buttons. Once clicked the result set JTable is displayed fully in the JFrame possibly with another button to bring the user back to the initial button panel.
import java.io.*;
import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.table.*;
public class Test12 extends JFrame {
// java.sql types needed for database processing
private Connection connection;
private Statement statement;
private ResultSet resultSet;
private ResultSetMetaData rsMetaData;
// javax.swing types needed for GUI
private JTable table;
private JTextArea inputQuery;
public Test12()
super( "Johnny Project" );
// The URL specifying the Books database to which
// this program connects using JDBC to connect to a
// Microsoft ODBC database.
// Load the driver to allow connection to the database
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String myFilename = JOptionPane.showInputDialog("Enter Database Location");
String myDatabase = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
myDatabase+= myFilename.trim() + ";DriverID=22;READONLY=true}";
connection = DriverManager.getConnection(myDatabase,"","");
catch ( ClassNotFoundException cnfex ) {
System.err.println(
"Failed to load JDBC/ODBC driver." );
cnfex.printStackTrace();
System.exit( 1 ); // terminate program
catch ( SQLException sqlex ) {
System.err.println( "Unable to connect" );
sqlex.printStackTrace();
System.exit( 1 ); // terminate program
//If connection succeeds - build GUI
buildMenu();
buildGUI();
setSize(800, 800);
show();
private void getTable(String recievedQuery)
try {
String query = recievedQuery;
statement = connection.createStatement();
resultSet = statement.executeQuery(query);
displayResultSet(resultSet);
catch (SQLException sqlex) {
sqlex.printStackTrace();
private void displayResultSet(ResultSet rs)
throws SQLException
// position to first record
boolean moreRecords = rs.next();
// If there are no records, display a message
if (! moreRecords) {
JOptionPane.showMessageDialog( this,
"ResultSet contained no records" );
setTitle( "No records to display" );
return;
Vector columnHeads = new Vector();
Vector rows = new Vector();
try {
// get column heads
ResultSetMetaData rsmd = rs.getMetaData();
for ( int i = 1; i <= rsmd.getColumnCount(); ++i )
columnHeads.addElement( rsmd.getColumnName( i ) );
// get row data
do {
rows.addElement( getNextRow( rs, rsmd ) );
} while ( rs.next() );
// display table with ResultSet contents
table = new JTable( rows, columnHeads );
JScrollPane scroller = new JScrollPane( table );
Container c = getContentPane();
c.remove( 1 );
c.add( scroller, BorderLayout.CENTER );
c.validate();
catch ( SQLException sqlex ) {
sqlex.printStackTrace();
private Vector getNextRow( ResultSet rs, ResultSetMetaData rsmd )
throws SQLException
Vector currentRow = new Vector();
for ( int i = 1; i <= rsmd.getColumnCount(); ++i )
switch( rsmd.getColumnType( i ) ) {
case Types.VARCHAR:
case Types.LONGVARCHAR:
currentRow.addElement( rs.getString( i ) );
break;
case Types.INTEGER:
currentRow.addElement(
new Long( rs.getLong( i ) ) );
break;
default:
System.out.println( "Type was: " +
rsmd.getColumnTypeName( i ) );
return currentRow;
public void shutDown()
try {
connection.close();
catch ( SQLException sqlex ) {
System.err.println( "Unable to disconnect" );
sqlex.printStackTrace();
private void buildGUI()
inputQuery = new JTextArea(4, 30);
Icon people = new ImageIcon("people.gif");
JButton searchAll = new JButton("All", people);
searchAll.setToolTipText("Search All People");
searchAll.setBorder(null);
searchAll.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e)
String searchAllString = new String("Select * from 0001_per_year");
getTable(searchAllString);
JButton searchPathway = new JButton("Pathway", people);
searchPathway.setToolTipText("Search Students by Pathway");
searchPathway.setBorder(null);
searchPathway.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e)
String searchPathwayString = new String("Select Student_Number, Pathway from 0001_per_year");
getTable(searchPathwayString);
JButton searchPeriod = new JButton("Study", people);
searchPeriod.setToolTipText("Search Students by Period");
searchPeriod.setBorder(null);
searchPeriod.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e)
String searchPeriodString = new String("Select Student_Number, Period_of_Study from 0001_per_year");
getTable(searchPeriodString);
JButton searchAttendance = new JButton("Attendance", people);
searchAttendance.setToolTipText("Search Students by Attendance");
searchAttendance.setBorder(null);
searchAttendance.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e)
String searchAttendanceString = new String("Select Student_Number, Attendance_Status from 0001_per_year");
getTable(searchAttendanceString);
JLabel j1 = new JLabel ();
JLabel j2 = new JLabel ();
JLabel j3 = new JLabel ();
JLabel j4 = new JLabel ();
JLabel j5 = new JLabel ();
JLabel j6 = new JLabel ();
JLabel j7 = new JLabel ();
JLabel j8 = new JLabel ();
JLabel j9 = new JLabel ();
JLabel j10 = new JLabel ();
JLabel j11 =new JLabel ();
JLabel j12 = new JLabel ();
GridLayout grid;
grid = new GridLayout(4,4);
JPanel topPanel = new JPanel();
topPanel.setLayout(grid);
topPanel.add(j1);
topPanel.add(j2);
topPanel.add(j3);
topPanel.add(j4);
topPanel.add(j5);
topPanel.add(searchAll);
topPanel.add(searchPathway);
topPanel.add(j6);
topPanel.add(j7);
topPanel.add(searchPeriod);
topPanel.add(searchAttendance);
topPanel.add(j8);
topPanel.add(j9);
topPanel.add(j10);
topPanel.add(j11);
topPanel.add(j12);
table = new JTable();
Container c = getContentPane();
c.setLayout( new BorderLayout() );
c.add( topPanel, BorderLayout.NORTH );
c.add( table, BorderLayout.CENTER );
show();
private void buildMenu()
JMenuBar myMenuBar = new JMenuBar();
JMenu myFileMenu = new JMenu("File");
JMenuItem myExitItem = new JMenuItem("Exit");
//Exit item closes the application
myExitItem.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
System.exit(0);
myFileMenu.add(myExitItem);
myMenuBar.add(myFileMenu);
setJMenuBar(myMenuBar);
public static void main( String args[] )
final Test12 app = new Test12();
app.addWindowListener(
new WindowAdapter() {
public void windowClosing( WindowEvent e )
app.shutDown();
System.exit( 0 );Your welcome. I don't really compete for Duke's, but I'm glad the issue is resolved.
- Saish
"My karma ran over your dogma." - Anon
Maybe you are looking for
-
Upgrade my iPhone 4 from iOS 5.0.1 to 7.1.2?
Someone help me on how to upgrade my iPhone 4 from iOS 5.0.1 to 7.1.2 pls...
-
In tune show all summary activity during sync between nb and apple device. One of the summary is memory space status. Audio mayb3gb, photo 2gb, app with 3gb. What is other? Other consist of what type of file? It show quite substantial storage capacit
-
Switching to Mac, how to set up After Effects
I just received my new Mac Pro and subscribed to Adobe Cloud. I'm setting up After Effects and need to set my Media Cache for fast processing. I am reading that I should set it to write to a separate hard drive from what I am saving my project to,
-
Database recovery from the server backup - 10g Oracle with Linux
My server OS is Linux and nightly we are taking a whole logical volumes backup as it is and databses are not shutdown. so i would like to know how much worth keeping this copy in recovery purposes as it is taking few hours to copy all daily. If some
-
How do i edit content type name or remove in applications panel
how do i edit content type name or remove the name in applications panel.In the App panel the name is Winrar zip Archive. when i try to download rar file is all way ask me what to do.when i download zip file is save the files.I would like to add rar