masijade 1,351 Industrious Poster Team Colleague Featured Poster

use the following:

eval var=server$i

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, you can call the client program (sqlplus for oracle or mysql for mysql etc etc)
and redirect input with the commands you want and try to capture and evaluate the
output. Here an example from mysql with a simple select query:

mysql -uuser -ppassword -hhost <<EOF >filename
use mysql;
select * from user;
EOF

Then you have the output in "filename" and can do with it what you want.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If the only thing in the file is filenames simply do
rm `cat input.txt`
if there is more than just filenames, but say the third word of
every line is a filename then do the following:
rm `awk '{print $3}' input.txt`
(the fourth word would be $4, etc)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I am not sure what you are really trying to say here
>file means to redirect the standard output to the file
named. 2>&1 means redirect standard error to the file
descriptor of standard out so that error messages go to
the same place, using the same channel as the normal
output. if using 2>&1 gives you more output than a
simple redirect, then the extra outputs are actually error
messages.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why don't you write a properties file for your java program and just change
entries in that according to the server it is running on, rather than hard coding
the connect information into the java program (which, coincedentally, is bad
form anyway).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I won't claim to know why you are converting this to a GregorianCalendar, but I
will show you two things that you can try. In both these examples the line
from your post for creating "sdf" and "dateField2" should be kept and the line
creating startDate thrown out.

Here the first:
String reqdt = sdf.format(dateField2) ;

Here the second:
GregorianCalendar startDate = new GregorianCalendar( ) ;
startDate.setTime(dateField2) ;
String reqdt = sdf.format(startDate.getTime( ) ) ;

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A hit counter is many times best done with a filter. Go to java.sun.com and
look at the j2ee tutorial. It is long and you will have to search for the counter
examples, but they are there. And remember, that even if the filter example
is shown for a servlet, it will also work for a jsp, as a jsp is really nothing other
than a servlet that is compiled by the app server rather than being precompiled.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If all you have is a jre, then yes, you need to install a jdk. Servlets will work
without a jdk as they are compiled before tomcat ever sees them. JSP pages,
on the other hand, are translated into java classes/files and then compiled by
tomcat the first time they are accessed, or the first time they are accessed
after having been changed since the last time it was compiled. Tomcat cannot
do this unless it has access to a compiler (javac). It only has this if a jdk is
installed and JAVA_HOME points to the jdk, not the jre (which is also included in
the jdk as a jre subdirectory).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That was quick. I'm glad I was able to help.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This is a JSP/JAVA forum not Visual Basic

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, you could write a stop method and rewrite the "start" method to use
threads, then after you instantiate the class, store it as a session variable, then
start the "start" method as a thread. Then return a page containing the key used
to store the object and stop button. The stop button will call another jsp that
will retreive the object stored under that key and call the "stop" method. This is
all really loosely explained, but you should be able to extrapolate from here.
Unfortunately, your user will also get no notification that the process is finished.
You could, however, write a checkProgress method that another jsp can use to check the process and "refreshes" from time to time. This would have to called
using a refresh from the "stop button" page and also then must contain the "stop
button".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

root cause
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

Have you actually checked your setenv/catalina script to
ensure that the variable JAVA_HOME points to a JDK
(i.e. /usr/java) or to a jre (i.e. /usr/java/jre). If your
JAVA_HOME variable points to a jre, then there is no javac
(as the error message says) to use inorder to compile the
jsp.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

try the following:

public void printLoop(int index; char[] list; char[] string) {
  if (index == list.length) {
    System.out.print(new String(string) + " ");
    return;
  }

  for (int i = 0; i < list.length; i++) {
    string[index] = list[i];
    printLoop(index + 1, list, string);
  }
}

char[] string = new char[list.length];

for (int i = 0; i < list.length; i++) {
  string[0] = list[i];
  printLoop(1, list, string);
  System.out.println("");
}