Re: How to export data to excel sheet from JSP

2002-11-27 Thread Ron Chan
maybe,
http://jakarta.apache.org/poi/

--- Murali Mohan <[EMAIL PROTECTED]> wrote:
> Please elaborate it.
>
> "Josep R. Raurell" wrote:
>
> > You must use csv format: a text file with values
> separated with ";" or tabs.
> >
> > En/na Murali Mohan ha escrit:
> >
> > >Hi,
> > >
> > >How to export data to excel sheet from
> JSP?
> > >
> > >Any Idea???
> > >
> > >Thanks,
> > >Murali
> > >
> >
>
>===
> > >To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> > >For digest: mailto [EMAIL PROTECTED] with
> body: "set JSP-INTEREST DIGEST".
> > >Some relevant FAQs on JSP/Servlets can be found
> at:
> > >
> > > http://archives.java.sun.com/jsp-interest.html
> > > http://java.sun.com/products/jsp/faq.html
> > > http://www.esperanto.org.nz/jsp/jspfaq.jsp
> > > http://www.jguru.com/faq/index.jsp
> > > http://www.jspinsider.com
> > >
> > >
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with
> body: "set JSP-INTEREST DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://archives.java.sun.com/jsp-interest.html
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.jsp
> >  http://www.jguru.com/faq/index.jsp
> >  http://www.jspinsider.com
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body:
> "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: How to convert hostname to IP address ?

2002-02-06 Thread Ron Chan

hi,

i believe if you ping it, the output shows the
numbers.


--- sufi malak <[EMAIL PROTECTED]> wrote:
> Hi, how to convert a hostname to an IP address ??
> thanks
>
>
>
>
_
> Join the world?s largest e-mail service with MSN
> Hotmail.
> http://www.hotmail.com
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body:
> "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com


__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: string to char

2001-09-20 Thread Ron Chan

javadocs for String:

toCharArray

public char[] toCharArray()

Converts this string to a new character array.

Returns:
a newly allocated character array whose length is
the length of this string and whose contents are
initialized to contain the character sequence
represented by this string.




--- KL OOI <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> sorry for the off topic here, how to convert a
> string to char ??
>
> thanks..
>
> regards,
> kl
>
>
>
_
> Do You Yahoo!?
> Get your free @yahoo.com address at
> http://mail.yahoo.com
>
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body:
> "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: code Security in java

2001-08-14 Thread Ron Chan

1. get good lawyers.
2. keep your customers happy and have no incentive to
do mischieve!
3. do important computations remotely in a distributed
manner.


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: e-mail

2001-07-09 Thread Ron Chan

try,

http://www.jspinsider.com/tutorials/jsp/javamail/jspjavamail_intro.jsp


--- Johann Eder <[EMAIL PROTECTED]> wrote:
> HI,
>
> can anyone tell me how to send e-Mails per JSP ?
>
> Any info and idea welcome...
>
> Thanks
>
> Hans
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body:
> "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Checking for Empty Result Set

2001-06-18 Thread Ron Chan

hi,

why not:

rs = pstmt.executeQuery();
boolean b = false;
if( b = rs.next() ) {
 while( b ) {
   //... rs.getXXX( YYY );
   b = rs.next();
 }
}
else {
  //...empty rs processing
}


===

this works for sure. But how do I know the case when
the result set is empty ?
Thanks,
Sunil.
--- Ron Chan <[EMAIL PROTECTED]> wrote:
> hi,
>
> only just saw this thread so maybe not understanding
> the entire problem but it sound like you want to do:
>
> rs = pstmt.executeQuery();
> boolean b = rs.next();
> while( b ) {
>   ... rs.getXXX( YYY );
>   b = rs.next();
> }
>

__
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Checking for Empty Result Set

2001-06-18 Thread Ron Chan

hi,

only just saw this thread so maybe not understanding
the entire problem but it sound like you want to do:

rs = pstmt.executeQuery();
boolean b = rs.next();
while( b ) {
  ... rs.getXXX( YYY );
  b = rs.next();
}

--- sunil_s23 <[EMAIL PROTECTED]> wrote:
> This definitely caters to the case when there is
> only
> one row in the result set; but what about the case
> if
> the result set contains more than one row. I am
> looking for a solution which will handle both single
> row results and multiple row results as well as the
> case when the result set is empty.
> Any suggestions ?,
> Thanks,
> Sunil.


__
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Organizing Application Constants

2001-04-09 Thread Ron Chan

Hi,

have a look at:

http://www.amazon.com/exec/obidos/ASIN/0130258784/ref=cm_mp_wl/102-0605334-4278509?colid=1GAUDJ7KO2QH2

using a 'strategy' pattern, you can generate all the
classes you need and they should be invoked
'transparently'. you can restrict the classes to
supply in a jar. Also, you can use dynamic loading to
load the relevant class.

ron

> > 2. you can put your ini info in an xml and use a
> > program generation approach.
>
>Do you mean automatic code generation from the
> xml? In my case I guess it
> would not be good. That's because I want to reuse
> the class in various
> applications instead of have it generated, even if
> it is automatic. I don't
> know much about this, though. Do you have any link
> for some good article or
> documentation about it?


__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: RES: Organizing Application Constants

2001-04-09 Thread Ron Chan

Hi,

btw, you can just use the .properties approach
(removing the 'extra' classes) directly and I think
that will be what you want.

sorry for the misunderstanding.

ron


> --- Rodrigo Gevaerd <[EMAIL PROTECTED]> wrote:
> >Thanks for your replies, Ron. But I think you
> did
> > not quite understand
> > the kind of problem here. The problem is how to do
> > the functionallity of the
> > code you wrote but without having to write another
> > class like App1Constant
> > or App2Constant when you add another application
> to
> > the server. More than
> > that... actually I want no change to code at all.
> > This can be done, for
> > example, this way:
> >
> >Have this start up code to run before anything
> > else in the application:
> >
> > getServletContext().setAttribute("Const", new
> > Constant(getServletContext()));
> >
> >And at Constant do:
> >
> > public Constant(ServletContext sc)
> > {
> >   String fileNameToReadValues =
> > sc.getRealPath("/constant.ini");
> >
> >   // read values from 'fileNameToReadValues'
> > }
> >
> >   This way, when adding another application, the
> > same code may be used. Only
> > the constant.ini file in the new application will
> be
> > different (because it
> > will contain the values the application will use).
> > But there is a problem
> > doing this way: all classes that want access to
> > Constant must have access to
> > ServletContext, because only that way they will
> > obtain the right Constant
> > instance (through the getAttribute method). This
> > problem can be worked out
> > by giving every class a reference to
> ServletContext.
> > But I was asking if
> > anyone have a better solution for this problem
> than
> > doing all these.
> >
> >
> > Rodrigo.
> >
> >
> > > -Mensagem original-
> > > De: Ron Chan [mailto:[EMAIL PROTECTED]]
> > > Enviada em: Segunda-feira, 9 de Abril de 2001
> > 13:25
> > > Para: [EMAIL PROTECTED]
> > > Assunto: Re: Organizing Application Constants
> > >
> > >
> > > hi,
> > >
> > > something like:
> > >
> > >
> > >  1  import java.util.*;
> > >
> > >  2  public abstract class AbstractConstant
> > >  3  {
> > >  4  public final static int APP1 = 1;
> > >  5  public final static int APP2 = 2;
> > >  6  private final static String cdb =
> > > "currentDB";
> > >  7  private final static String DBURL =
> > > "dbURL";
> > >
> > >  8  public static class App1Constant
> > extends
> > > AbstractConstant {
> > >  9  public App1Constant() {
> > > 10  super();
> > > 11  setDBUrl( rb.getString(
> DBURL
> > + currentDB
> > > + APP1 ) );
> > > 12  }
> > > 13  }
> > > 14  public static class App2Constant
> > extends
> > > AbstractConstant {
> > > 15  public App2Constant() {
> > > 16  super();
> > > 17  setDBUrl( rb.getString(
> DBURL
> > + currentDB
> > > + APP2 ) );
> > > 18  }
> > > 19  }
> > >
> > > 20  private String dbURL = null;
> > > 21  private String rbString = "ac";
> > > 22  protected ResourceBundle rb = null;
> > > 23  protected String currentDB = null;
> > >
> > > 24  public AbstractConstant() {
> > > 25  rb = ResourceBundle.getBundle(
> > rbString );
> > > 26  currentDB = rb.getString( cdb );
> > > 27  }
> > >
> > > 28  public void setDBUrl( String s ) {
> > > 29  this.dbURL = s;
> > > 30  }
> > > 31  public String getDBUrl() {
> > > 32  return this.dbURL;
> > > 33  }
> > > 34  public static AbstractConstant
> Create(
> > int
> > > i ) {
> > > 35  AbstractConstant ap = null;
> > > 36  if( APP1 == i ) {
> > > 37  ap = new
> > AbstractConstant.App1Constant();
> > > 38  }
> > > 39  else if( APP2 == i ) {
> > > 40  

Re: RES: Organizing Application Constants

2001-04-09 Thread Ron Chan

Hi,

1. why pass ServletContext, pass the String from
sc.getRealPath to a bean.

2. you can put your ini info in an xml and use a
program generation approach.

3. you can use a 'shell' class, that reads key/value
pairs into an 'ordered' hashtable (if order is
important), and have custom get( String key ) and set(
k, v) methods to change values in the ordered
hashtable.

just some thoughts.

ron

--- Rodrigo Gevaerd <[EMAIL PROTECTED]> wrote:
>Thanks for your replies, Ron. But I think you did
> not quite understand
> the kind of problem here. The problem is how to do
> the functionallity of the
> code you wrote but without having to write another
> class like App1Constant
> or App2Constant when you add another application to
> the server. More than
> that... actually I want no change to code at all.
> This can be done, for
> example, this way:
>
>Have this start up code to run before anything
> else in the application:
>
> getServletContext().setAttribute("Const", new
> Constant(getServletContext()));
>
>And at Constant do:
>
> public Constant(ServletContext sc)
> {
>   String fileNameToReadValues =
> sc.getRealPath("/constant.ini");
>
>   // read values from 'fileNameToReadValues'
> }
>
>   This way, when adding another application, the
> same code may be used. Only
> the constant.ini file in the new application will be
> different (because it
> will contain the values the application will use).
> But there is a problem
> doing this way: all classes that want access to
> Constant must have access to
> ServletContext, because only that way they will
> obtain the right Constant
> instance (through the getAttribute method). This
> problem can be worked out
> by giving every class a reference to ServletContext.
> But I was asking if
> anyone have a better solution for this problem than
> doing all these.
>
>
> Rodrigo.
>
>
> > -Mensagem original-
> > De: Ron Chan [mailto:[EMAIL PROTECTED]]
> > Enviada em: Segunda-feira, 9 de Abril de 2001
> 13:25
> > Para: [EMAIL PROTECTED]
> > Assunto: Re: Organizing Application Constants
> >
> >
> > hi,
> >
> > something like:
> >
> >
> >  1  import java.util.*;
> >
> >  2  public abstract class AbstractConstant
> >  3  {
> >  4  public final static int APP1 = 1;
> >  5  public final static int APP2 = 2;
> >  6  private final static String cdb =
> > "currentDB";
> >  7  private final static String DBURL =
> > "dbURL";
> >
> >  8  public static class App1Constant
> extends
> > AbstractConstant {
> >  9  public App1Constant() {
> > 10  super();
> > 11  setDBUrl( rb.getString( DBURL
> + currentDB
> > + APP1 ) );
> > 12  }
> > 13  }
> > 14  public static class App2Constant
> extends
> > AbstractConstant {
> > 15  public App2Constant() {
> > 16  super();
> > 17  setDBUrl( rb.getString( DBURL
> + currentDB
> > + APP2 ) );
> > 18  }
> > 19  }
> >
> > 20  private String dbURL = null;
> > 21  private String rbString = "ac";
> > 22  protected ResourceBundle rb = null;
> > 23  protected String currentDB = null;
> >
> > 24  public AbstractConstant() {
> > 25  rb = ResourceBundle.getBundle(
> rbString );
> > 26  currentDB = rb.getString( cdb );
> > 27  }
> >
> > 28  public void setDBUrl( String s ) {
> > 29  this.dbURL = s;
> > 30  }
> > 31  public String getDBUrl() {
> > 32  return this.dbURL;
> > 33  }
> > 34  public static AbstractConstant Create(
> int
> > i ) {
> > 35  AbstractConstant ap = null;
> > 36  if( APP1 == i ) {
> > 37  ap = new
> AbstractConstant.App1Constant();
> > 38  }
> > 39  else if( APP2 == i ) {
> > 40  ap = new
> AbstractConstant.App2Constant();
> > 41  }
> > 42  return ap;
> > 43  }
> > 44  }
> >
> >
> > 45  public class App1
> > 46  {
> > 47  private AbstractConstant abcon =
> > AbstractConstant.Create( AbstractConstant.APP1 );
> > 48  public App1() {
> > 49  System.o

Re: Organizing Application Constants

2001-04-09 Thread Ron Chan

hi,

something like:


 1  import java.util.*;

 2  public abstract class AbstractConstant
 3  {
 4  public final static int APP1 = 1;
 5  public final static int APP2 = 2;
 6  private final static String cdb =
"currentDB";
 7  private final static String DBURL =
"dbURL";

 8  public static class App1Constant extends
AbstractConstant {
 9  public App1Constant() {
10  super();
11  setDBUrl( rb.getString( DBURL + currentDB
+ APP1 ) );
12  }
13  }
14  public static class App2Constant extends
AbstractConstant {
15  public App2Constant() {
16  super();
17  setDBUrl( rb.getString( DBURL + currentDB
+ APP2 ) );
18  }
19  }

20  private String dbURL = null;
21  private String rbString = "ac";
22  protected ResourceBundle rb = null;
23  protected String currentDB = null;

24  public AbstractConstant() {
25  rb = ResourceBundle.getBundle( rbString );
26  currentDB = rb.getString( cdb );
27  }

28  public void setDBUrl( String s ) {
29  this.dbURL = s;
30  }
31  public String getDBUrl() {
32  return this.dbURL;
33  }
34  public static AbstractConstant Create( int
i ) {
35  AbstractConstant ap = null;
36  if( APP1 == i ) {
37  ap = new AbstractConstant.App1Constant();
38  }
39  else if( APP2 == i ) {
40  ap = new AbstractConstant.App2Constant();
41  }
42  return ap;
43  }
44  }


45  public class App1
46  {
47  private AbstractConstant abcon =
AbstractConstant.Create( AbstractConstant.APP1 );
48  public App1() {
49  System.out.println( "1 dburl: " +
abcon.getDBUrl() );
50  }
51  public static void main( String[] arg ) {
52  App1 ap = new App1();
53  }
54  }


55  public class App2
56  {
57  private AbstractConstant abcon =
AbstractConstant.Create( AbstractConstant.APP2 );
58  public App2() {
59  System.out.println( "2 dburl: " +
abcon.getDBUrl() );
60  }
61  public static void main( String[] arg ) {
62  App2 ap = new App2();
63  }
64  }

65  currentDB=oracle
66  dbURLpostgres1=something1
67  dbURLpostgres2=something2

68  dbURLoracle1=somethingElse1
69  dbURLoracle2=somethingElse2

ron

--- Rodrigo Gevaerd <[EMAIL PROTECTED]> wrote:
>I guess that would work fine. But I am searching
> for a solution for any
> number of application, without the need of changing
> code because the add or
> removal of an application. If anyone thinking about
> how will the constants
> values be different then, they are read from .ini
> text files, that are
> different because they look for each in the context
> of their own web
> application.
>
>Rodrigo.
>
> >
> > Hi,
> >
> > Maybe something like:
> >
> >
> >  1  public abstract class AbstractConstant
> >  2  {
> >  3  private final static int APP1 = 1;
> >  4  private final static int APP2 = 2;
> >
> >  5  public static class App1Constant
> extends
> > AbstractConstant {
> >  6  public App1Constant() {
> >  7  setDBUrl( "some value for
> App1" );
> >  8  }
> >  9  }
> > 10  public static class App2Constant
> extends
> > AbstractConstant {
> > 11  public App2Constant() {
> > 12  setDBUrl( "some value for
> App2" );
> > 13  }
> > 14  }
> >
> > 15  private String dbURL = null;
> > 16  public void setDBUrl( String s ) {
> > 17  this.dbURL = s;
> > 18  }
> > 19  public String getDBUrl() {
> > 20  return this.dbURL;
> > 21  }
> > 22  public static AbstractConstant Create(
> int
> > i ) {
> > 23  AbstractConstant ap = null;
> > 24  if( APP1 == i ) {
> > 25  ap = new
> AbstractConstant.App1Constant();
> > 26  }
> > 27  else if( APP2 == i ) {
> > 28  ap = new
> AbstractConstant.App2Constant();
> > 29  }
> > 30  return ap;
> > 31  }
> > 32  }
> >
> >
> > 33  public class App1
> > 34  {
> > 35  private AbstractConstant abcon =
> > AbstractConstant.Create( 1 );
> > 36  public App1() {
> > 37  System.out.println( "1 dburl: " +
> > abcon.getDBUrl() );
> > 38  }
> > 39  public static void main( String[] arg
> ) {
> > 40  App1 ap = new App1();
> > 41  }
> > 42  }
> >
> >
> > 43  public class App2
> > 44  {
> > 45  private AbstractConstant abcon =
> > AbstractConstant.Create( 2 );
> >   

Re: Organizing Application Constants

2001-04-09 Thread Ron Chan

Hi,

in a .properties file

1. have an entry indicating the currentDB=someDBName

2. have as many dbURL concatenated with the supported
db names eg:
dbURLOracle="oracle:1521:someWhere"
dbURLDB2="..."

initialize your memory object using the ResourceBundle
by first getting the currentDB, then using that string
get the other values eg getString( "dbURL" + currentDB
);

ron
--- Rodrigo Gevaerd <[EMAIL PROTECTED]> wrote:
>I guess that would work fine. But I am searching
> for a solution for any
> number of application, without the need of changing
> code because the add or
> removal of an application. If anyone thinking about
> how will the constants
> values be different then, they are read from .ini
> text files, that are
> different because they look for each in the context
> of their own web
> application.
>
>Rodrigo.
>
> >
> > Hi,
> >
> > Maybe something like:
> >
> >
> >  1  public abstract class AbstractConstant
> >  2  {
> >  3  private final static int APP1 = 1;
> >  4  private final static int APP2 = 2;
> >
> >  5  public static class App1Constant
> extends
> > AbstractConstant {
> >  6  public App1Constant() {
> >  7  setDBUrl( "some value for
> App1" );
> >  8  }
> >  9  }
> > 10  public static class App2Constant
> extends
> > AbstractConstant {
> > 11  public App2Constant() {
> > 12  setDBUrl( "some value for
> App2" );
> > 13  }
> > 14  }
> >
> > 15  private String dbURL = null;
> > 16  public void setDBUrl( String s ) {
> > 17  this.dbURL = s;
> > 18  }
> > 19  public String getDBUrl() {
> > 20  return this.dbURL;
> > 21  }
> > 22  public static AbstractConstant Create(
> int
> > i ) {
> > 23  AbstractConstant ap = null;
> > 24  if( APP1 == i ) {
> > 25  ap = new
> AbstractConstant.App1Constant();
> > 26  }
> > 27  else if( APP2 == i ) {
> > 28  ap = new
> AbstractConstant.App2Constant();
> > 29  }
> > 30  return ap;
> > 31  }
> > 32  }
> >
> >
> > 33  public class App1
> > 34  {
> > 35  private AbstractConstant abcon =
> > AbstractConstant.Create( 1 );
> > 36  public App1() {
> > 37  System.out.println( "1 dburl: " +
> > abcon.getDBUrl() );
> > 38  }
> > 39  public static void main( String[] arg
> ) {
> > 40  App1 ap = new App1();
> > 41  }
> > 42  }
> >
> >
> > 43  public class App2
> > 44  {
> > 45  private AbstractConstant abcon =
> > AbstractConstant.Create( 2 );
> > 46  public App2() {
> > 47  System.out.println( "2 dburl: " +
> > abcon.getDBUrl() );
> > 48  }
> > 49  public static void main( String[] arg
> ) {
> > 50  App2 ap = new App2();
> > 51  }
> > 52  }
> >
> >
> > ron
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body:
> "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: RES: Organizing Application Constants

2001-04-09 Thread Ron Chan

Hi,

Maybe something like:


 1  public abstract class AbstractConstant
 2  {
 3  private final static int APP1 = 1;
 4  private final static int APP2 = 2;

 5  public static class App1Constant extends
AbstractConstant {
 6  public App1Constant() {
 7  setDBUrl( "some value for App1" );
 8  }
 9  }
10  public static class App2Constant extends
AbstractConstant {
11  public App2Constant() {
12  setDBUrl( "some value for App2" );
13  }
14  }

15  private String dbURL = null;
16  public void setDBUrl( String s ) {
17  this.dbURL = s;
18  }
19  public String getDBUrl() {
20  return this.dbURL;
21  }
22  public static AbstractConstant Create( int
i ) {
23  AbstractConstant ap = null;
24  if( APP1 == i ) {
25  ap = new AbstractConstant.App1Constant();
26  }
27  else if( APP2 == i ) {
28  ap = new AbstractConstant.App2Constant();
29  }
30  return ap;
31  }
32  }


33  public class App1
34  {
35  private AbstractConstant abcon =
AbstractConstant.Create( 1 );
36  public App1() {
37  System.out.println( "1 dburl: " +
abcon.getDBUrl() );
38  }
39  public static void main( String[] arg ) {
40  App1 ap = new App1();
41  }
42  }


43  public class App2
44  {
45  private AbstractConstant abcon =
AbstractConstant.Create( 2 );
46  public App2() {
47  System.out.println( "2 dburl: " +
abcon.getDBUrl() );
48  }
49  public static void main( String[] arg ) {
50  App2 ap = new App2();
51  }
52  }


ron


--- Rodrigo Gevaerd <[EMAIL PROTECTED]> wrote:
>That works fine when you got only one application
> using that class
> Constants. The problem appears in my case, where i
> got more than one
> application with the same classe Constants. It
> cannot be implemented as
> static because the values must be different for each
> application. My daught
> is what is the better way to organize the Constants
> instances, so that they
> may be easily accessible by all parts of the
> application and work with many
> applications on the same server using it. The best
> way I found until now is
> to on all classes' constructors receive the
> Constants instance as parameter
> and keep its reference on all classes so all may use
> it. Does anyone have
> any suggestion for this kind of problem?
>
> Rodrigo.
>
>
> > -Mensagem original-
> > De: Rob L'Estrange [mailto:[EMAIL PROTECTED]]
> > Enviada em: Sábado, 7 de Abril de 2001 11:37
> > Para: [EMAIL PROTECTED]
> > Assunto: Re: Organizing Application Constants
> >
> >
> > I usually put my constants in a class called
> Constants. I
> > implement them as
> > final and static. I'd then deploy the class in my
> location
> > accessible to all
> > web applications running in my JSP/Servlet server.
> I think
> > this location
> > would be server specific (but I could be
> mistaken). From any
> > web app, I can
> > then access Constants.someConstant.
> >
> > Note that when you make any changes to your
> Constants class, you will
> > probably need to restart your JSP/Servlet server
> to force a
> > reload of the
> > class.
> >
> > Rob
> >
> >
> > - Original Message -
> > From: "Rodrigo Gevaerd" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, April 06, 2001 2:22 PM
> > Subject: Organizing Application Constants
> >
> >
> > >   I got an application that has several
> constants (for
> > example, database
> > > url). The application consists of several JSPs
> for presentation and
> > classes
> > > for the persistence. How can I keep the
> application
> > constants, so that 2
> > > applications of this type (with different
> constants values)
> > can co-exist
> > in
> > > the same JVM (possibly in different web
> applications)? It
> > was developed
> > > initially keeping the constants in a singleton
> class. But
> > with more than
> > one
> > > application it cannot be done like that. The
> constants
> > could be kept in
> > the
> > > ServletContext, but the classes would not have
> access to
> > them (unless each
> > > were given the SerlvetContext reference). Does
> anyone has
> > any idea for a
> > > solution for this situation?
> > >
> > > []'s,
> > > Rodrigo.
> > >
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body:
> "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?n

Welcome to the JoSePh-INTEREST list, :),

2001-02-22 Thread Ron Chan

Hi JoSePh,

many (not all) appreciate what you do.
many (not all) appreciate your opinion, sarcasm and
knowledge.

many (not all) would probably appreciate you email the
'offenders' directly.

thanks,

ron


--- Nasser Dassi <[EMAIL PROTECTED]> wrote:
> NOBODY CARES, ANYMORE.
>
> NOBODY LOVES YOU.
>
> NOBODY WANTS TO BE YOUR FRIEND.
>
> Everybody, please.  We have feelings, but this is
> not the arena to share
> feelings about Mr. Ottinger.
>
> His email is [EMAIL PROTECTED]  Email him, converse
> with him.
>
> I WANT MORE JSP-BASED ANSWERS, CODE SNIPPETS, HELP,
> ADVICE.
>
> SHUT UP!  NOBODY LOVES YOU.
>
> Yours,
>
>   Nasser Dassi
>   Software & Internet Developer
>   [EMAIL PROTECTED]
>
>   "Openmindedness Rewards A Lifetime"
>
> PS:  NOTE THE ABOVE QUOTE!!!
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body:
> "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: JSP/Array/JDBC

2000-12-08 Thread Ron Chan

hi,

try:
http://java.sun.com/docs/books/tutorial/uiswing/events/tablemodellistener.html

see teh TableSorter.

ron


--- Dan Lopez <[EMAIL PROTECTED]> wrote:
> Need Help!
>
> I had been retrieving data from Sybase databse.
> This
> was working fine.  I was querying views created from
> external db outside my sybase environment.  I
> displayed the data on JSP page.  The only problem is
> that I cannot sort, since the views that were
> created
> (which I cannot change, since this is out of my
> control...change management, blah!) do not allow SQL
> functions other than "select * from my_view".  I
> would
> like to know if it is possible to put the data into
> variables and place them into an array.  Then sort
> using the array.  I have never really used arrays
> before.
>
> So, in short:
> 1.  Can this be done?
> 2.  HOW is it done?
>
>
> Thanks All
>
> Dan
>
> __
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of
> Products.
> http://shopping.yahoo.com/
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body:
> "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Send Mail Example

2000-11-14 Thread Ron Chan

Hi,

the central stuff follows. Put the appropriate
parameters into a hashtable and call this method.

ron


   private void sendMail( Hashtable params ) throws
AddressException, MessagingException
  {
 String mailServer = (String) params.get(
"mailServer" );
 String subject = (String) params.get(
"subject" );
 String to[] = (String[]) params.get( "to" );
 String cc[] = (String[]) params.get( "cc" );
 String from = (String) params.get( "from" );
 String messageText = (String) params.get(
"messageText" );
 Properties mailProps = new Properties();
 mailProps.put( "mail.smtp.host", mailServer
);
 Session mailSession =
Session.getDefaultInstance( mailProps, null );
 int toCount = to.length;
 InternetAddress[] toAddr = new
InternetAddress[ toCount ];
 for( int i = 0; i < toCount; i++ )
 {
toAddr[ i ] = new InternetAddress( to[ i
].trim() );
 }
 InternetAddress[] ccAddr = null;
 if( null != cc )
 {
int ccCount = cc.length;
ccAddr = new InternetAddress[ ccCount ];
for( int i = 0; i < ccCount; i++ )
{
   ccAddr[ i ] = new InternetAddress( cc[ i
].trim() );
}
 }
 InternetAddress fromAddr = new
InternetAddress( from.trim() );
 Message message = new MimeMessage(
mailSession );
 message.setFrom( fromAddr );
 message.setRecipients(
Message.RecipientType.TO, toAddr );
 if( null != ccAddr )
message.setRecipients( Message.RecipientType.CC,
ccAddr );
 message.setSubject( subject );
 //message.setContent( messageText,
"text/html" );
 //message.setText( messageText );

 MimeMultipart mp = new MimeMultipart();
 MimeBodyPart b1 = new MimeBodyPart();
 b1.setContent( messageText, "text/html" );
 mp.addBodyPart( b1 );
 message.setContent( mp );
 message.saveChanges();

 //message.setDataHandler(new DataHandler(new
ByteArrayDataSource(messageText, "text/html")));
 Transport.send( message );
  }



--- "Antonio W. Lagnada" <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> Does anyone have a simple example on how send an
> email for in JSP or
> Servlet?
>
> Any help would be appreciated.
> Thanks
>
> --
> Antonio W. Lagnada
> Ecommerce Consultant
> [EMAIL PROTECTED]
>
> This email address is specifically
> for JSP-Interest email list.
> Remove _NOSPAM for the actual email.
>
>
>
>
___
> To get your own FREE ZDNet Onebox - FREE voicemail,
> email, and fax,
> all in one place - sign up today at
> http://www.zdnetonebox.com
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: resultset to jsp

2000-11-13 Thread Ron Chan

Hi,

besides, the order of insertion and retrieval of the
entries are not the same using a hashtable.

TableModel is essentially a convenient wrapper around
a 2-D vector of Objects that is ready for JTable use;
or for row/col traversal in the HTML/jsp case.

ron


--- Sunil Roy <[EMAIL PROTECTED]> wrote:
> Hai Flores,
>
> Could You pl. tell me why we have to go thru so mch
> complication when we can
> achieve the same goal easily with a 2-d array, both
> for retrieval from
> resultset inside the servlet & also for displaying
> the result in the  JSP.
>
> What is the advantage of using a hashtable(
> containing vectors as its
> values),  instead of  simply using a 2-d array.
>
> Your method is definitely, but appears to be far too
> complicated compared to
> arrays.
>
> Bye
>
> Sunil Roy
>
> - Original Message -
> From: "T A Flores" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, November 04, 2000 9:33 PM
> Subject: Re: resultset to jsp
>
>
> > Duncan,
> >
> > You're right if the result set object is not
> passed to a collection it
> > will be lost when the stmt/connection is closed.
> I think enough of
> > this thread since it was already sufficiently
> covered.
> >
> > I have for those who have an inability to search
> the archive attached
> > the code in question.
> >
> > In the servlet . . . .
> >
> >  rs = stmt.executeQuery( sql );
> >  while (rs.next( ) ){
> >
> >  Vector vector = new Vector();
> >  vector.add(new Integer(rs.getInt("var1")));
> >  vector.add(new Integer(rs.getInt("var2")));
> >  vector.add(rs.getString("var3"));
> >  vector.add(rs.getString("var1"));
> >  hashtable.put(rs.getString("var1"),vector);
> >
> >  session.setAttribute("Name the hashtable",
> hashtable);
> >
> > then in the JSP . . . .
> > <%
> >  Enumeration enum=null;
> >  Hashtable ht = new Hashtable();
> >  Vector v = new Vector();
> >
> >  try{
> > ht =(Hashtable)
> session.getAttribute("HashtableName");
> >  enum = ht.keys();
> >  int i=0;
> >  }catch(Exception
> e){System.out.println(e.toString());}
> > %>
> > <%
> >while(enum.hasMoreElements()){
> >v = (Vector)
> ht.get(enum.nextElement());
> > %>
> > 
> > 
> > <%=v.get(0).toString()%>
> > <%=v.get(1).toString()%>
> > <%=v.get(2).toString()%>
> > 
> > <%
> >  }
> > %>
> >
> >
> >
> > - Original Message -
> > From: Duncan Rose <[EMAIL PROTECTED]>
> > Date: Saturday, November 4, 2000 6:28 am
> > Subject: Re: resultset to jsp
> >
> > > My understanding of it is that if you close the
> db
> > > connection or the prepared statement or
> whatever, the
> > > result set becomes invalid, so you can't
> reference
> > > the ResultSet object after a connection closure
> (i.e.
> > > the connection is not held open if you have a
> resultset
> > > reference, rather the reference becomes invalid
> if you
> > > close the connection).
> > >
> > > Could be wrong though.
> > >
> > >-Duncan
> > >
> > > -Original Message-
> > > From: Ron Chan [mailto:[EMAIL PROTECTED]]
> > > Sent: Saturday, November 04, 2000 2:02 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: resultset to jsp
> > >
> > >
> > > Hi,
> > >
> > > 1. you have a bean that does the database query.
> > > 2. either that bean or a utility, iterates the
> > > resultset for the column values, puts them into
> the
> > > TableModel. put the TableModel into the session.
> > > 3. In the jsp file, get from the session, and
> loop to
> > > display into .
> > >
> > > one reason for not using the resultset was my
> concern
> > > that the database connection is kept open. Can
> someone
> > > confirm whether this is true or not.
> > >
> > > thanks,
> > >
> > > ron
> > >
> > >
> > >
> > > --- T A Flores <[EMAIL PROTECTED]> wrote:
> > > > If you use the or JTable how exactly
> are you
> > > > getting the result
> > > > set from the Servlet/Bean?
> > &

Re: resultset to jsp

2000-11-05 Thread Ron Chan

Hi,

using hashtable.keys(), you do not get the original
insertion order of the entries.

1. extend hashtable with 'OrderedHashtable', that
allows one to return the original order and still have
the hashing retrieval.
2. the TableModel using twin vectors, does preserve
the original order. Probably use indexing by numbers
to retrieve than enumeration to be faster.

thanks,

ron


ps. please don't police a thread, it is over when it
is. This goes for that guy from JBuilder who
complaints about all vendor questions but I never see
those when it is about JBuilder




--- T A Flores <[EMAIL PROTECTED]> wrote:
> Duncan,
>
> You're right if the result set object is not passed
> to a collection it
> will be lost when the stmt/connection is closed.  I
> think enough of
> this thread since it was already sufficiently
> covered.
>
> I have for those who have an inability to search the
> archive attached
> the code in question.
>
> In the servlet . . . .
>
>  rs = stmt.executeQuery( sql );
>  while (rs.next( ) ){
>
>  Vector vector = new Vector();
>  vector.add(new Integer(rs.getInt("var1")));
>  vector.add(new Integer(rs.getInt("var2")));
>  vector.add(rs.getString("var3"));
>  vector.add(rs.getString("var1"));
>  hashtable.put(rs.getString("var1"),vector);
>
>  session.setAttribute("Name the hashtable",
> hashtable);
>
> then in the JSP . . . .
> <%
>  Enumeration enum=null;
>  Hashtable ht = new Hashtable();
>  Vector v = new Vector();
>
>  try{
> ht =(Hashtable)
> session.getAttribute("HashtableName");
>  enum = ht.keys();
>  int i=0;
>  }catch(Exception
> e){System.out.println(e.toString());}
> %>
> <%
>while(enum.hasMoreElements()){
>v = (Vector)
> ht.get(enum.nextElement());
> %>
> 
> 
> <%=v.get(0).toString()%>
> <%=v.get(1).toString()%>
> <%=v.get(2).toString()%>
> 
> <%
>  }
> %>
>
>
>
> - Original Message -
> From: Duncan Rose <[EMAIL PROTECTED]>
> Date: Saturday, November 4, 2000 6:28 am
> Subject: Re: resultset to jsp
>
> > My understanding of it is that if you close the db
> > connection or the prepared statement or whatever,
> the
> > result set becomes invalid, so you can't reference
> > the ResultSet object after a connection closure
> (i.e.
> > the connection is not held open if you have a
> resultset
> > reference, rather the reference becomes invalid if
> you
> > close the connection).
> >
> > Could be wrong though.
> >
> >-Duncan
> >
> > -Original Message-
> > From: Ron Chan [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, November 04, 2000 2:02 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: resultset to jsp
> >
> >
> > Hi,
> >
> > 1. you have a bean that does the database query.
> > 2. either that bean or a utility, iterates the
> > resultset for the column values, puts them into
> the
> > TableModel. put the TableModel into the session.
> > 3. In the jsp file, get from the session, and loop
> to
> > display into .
> >
> > one reason for not using the resultset was my
> concern
> > that the database connection is kept open. Can
> someone
> > confirm whether this is true or not.
> >
> > thanks,
> >
> > ron
> >
> >
> >
> > --- T A Flores <[EMAIL PROTECTED]> wrote:
> > > If you use the or JTable how exactly are
> you
> > > getting the result
> > > set from the Servlet/Bean?
> > >
> > > - Original Message -
> > > From: Ron Chan <[EMAIL PROTECTED]>
> > > Date: Friday, November 3, 2000 5:02 pm
> > > Subject: Re: resultset to jsp
> > >
> > > > Hi,
> > > >
> > > > why not put the resultset into a TableModel
> format
> > > for
> > > > transport. Whatever display, if AppleJTable,
> if
> > > html, can loop
> > > > rows and columns into a
> > > >  tag. etc.
> > > >
> > > > ron
> > > >
> > > >
> > > > --- T A Flores <[EMAIL PROTECTED]> wrote:
> > > > > It is possible, however, why would you want
> to
> > > use
> > > > > and array why not
> > > > > use a vector of hashtables.  I posted a
> response
> > > to
> > > > > a similiar problem

Re: resultset to jsp

2000-11-04 Thread Ron Chan

Hi,

1. you have a bean that does the database query.
2. either that bean or a utility, iterates the
resultset for the column values, puts them into the
TableModel. put the TableModel into the session.
3. In the jsp file, get from the session, and loop to
display into .

one reason for not using the resultset was my concern
that the database connection is kept open. Can someone
confirm whether this is true or not.

thanks,

ron



--- T A Flores <[EMAIL PROTECTED]> wrote:
> If you use the or JTable how exactly are you
> getting the result
> set from the Servlet/Bean?
>
> - Original Message -
> From: Ron Chan <[EMAIL PROTECTED]>
> Date: Friday, November 3, 2000 5:02 pm
> Subject: Re: resultset to jsp
>
> > Hi,
> >
> > why not put the resultset into a TableModel format
> for
> > transport. Whatever display, if AppleJTable, if
> html, can loop
> > rows and columns into a
> >  tag. etc.
> >
> > ron
> >
> >
> > --- T A Flores <[EMAIL PROTECTED]> wrote:
> > > It is possible, however, why would you want to
> use
> > > and array why not
> > > use a vector of hashtables.  I posted a response
> to
> > > a similiar problem
> > > using servlet to jsp last month (I believe more
> > > toward the middle of
> > > October).  Why don't you search the archive and
> see
> > > if that helps you
> > > at all.
> > >
> > > - Original Message -
> > > From: Ginni <[EMAIL PROTECTED]>
> > > Date: Monday, January 3, 2000 3:27 pm
> > > Subject: resultset to jsp
> > >
> > > > hi,
> > > >
> > > > I query my database and get a resultset in my
> bean
> > > , now is it
> > > > possible to
> > > > get all the records in the resultset into an
> > > array. i want to
> > > > retrieve this
> > > > array in my jsp and display the values there.
> is
> > > that possible
> > > >
> > > > there are 2 things here,
> > > >
> > > > 1. i need to get the resultset into an array
> (in
> > > asp, i use
> > > > getrows() for
> > > > this purpose)
> > > > 2. i need to get the array into my jsp. (could
> i
> > > use getProperty
> > > > for this)
> > > >
> > > > thanks for ur time,
> > > > :-)
> > > > Have a great Day!
> > > > -Ginni
> > > >
> > > >
> > >
> >
>

> > > ===
> > > > To unsubscribe: mailto [EMAIL PROTECTED]
> with
> > > body: "signoff
> > > > JSP-INTEREST".
> > > > Some relevant FAQs on JSP/Servlets can be
> found
> > > at:
> > > >
> > > > http://java.sun.com/products/jsp/faq.html
> > > > http://www.esperanto.org.nz/jsp/jspfaq.html
> > > >
> > >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > > >
> > >
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> > > >
> > >
> > >
> >
>

> ===
> > > To unsubscribe: mailto [EMAIL PROTECTED]
> with
> > > body: "signoff JSP-INTEREST".
> > > Some relevant FAQs on JSP/Servlets can be found
> at:
> > >
> > >  http://java.sun.com/products/jsp/faq.html
> > >  http://www.esperanto.org.nz/jsp/jspfaq.html
> > >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > >
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> >
> > __
> > Do You Yahoo!?
> > From homework help to love advice, Yahoo! Experts
> has your answer.
> > http://experts.yahoo.com/
> >
> >
>

> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> > JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.
http://shopping.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: resultset to jsp

2000-11-03 Thread Ron Chan

Hi,

why not put the resultset into a TableModel format for
transport. Whatever display, if Applet/App, can use
JTable, if html, can loop rows and columns into a
 tag. etc.

ron


--- T A Flores <[EMAIL PROTECTED]> wrote:
> It is possible, however, why would you want to use
> and array why not
> use a vector of hashtables.  I posted a response to
> a similiar problem
> using servlet to jsp last month (I believe more
> toward the middle of
> October).  Why don't you search the archive and see
> if that helps you
> at all.
>
> - Original Message -
> From: Ginni <[EMAIL PROTECTED]>
> Date: Monday, January 3, 2000 3:27 pm
> Subject: resultset to jsp
>
> > hi,
> >
> > I query my database and get a resultset in my bean
> , now is it
> > possible to
> > get all the records in the resultset into an
> array. i want to
> > retrieve this
> > array in my jsp and display the values there. is
> that possible
> >
> > there are 2 things here,
> >
> > 1. i need to get the resultset into an array (in
> asp, i use
> > getrows() for
> > this purpose)
> > 2. i need to get the array into my jsp. (could i
> use getProperty
> > for this)
> >
> > thanks for ur time,
> > :-)
> > Have a great Day!
> > -Ginni
> >
> >
>

> ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> > JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
>From homework help to love advice, Yahoo! Experts has your answer.
http://experts.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Hiding code

2000-10-26 Thread Ron Chan

Hi,

might as well try obfuscating the classes also!

ron


--- Dave Daniels <[EMAIL PROTECTED]> wrote:
> You should be able to precompile the JSPs, then
> distribute just the
> resulting class files.
>
> - Original Message -
> From: Kate McNamara <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, October 26, 2000 7:39 AM
> Subject: Hiding code
>
>
> > A weird question, and it's probably not possible,
> but as a part of a
> project
> > I have to supply my JSPs to a third party.  I
> don't want to reveal my
> code -
> > is there any way that I can avoid this?
> >
> > Cheers
> > Kate McNamara
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: off-topic: Thumbnail Generator

2000-10-25 Thread Ron Chan

Hi,

I presume you want to lower the resolution of the
uploaded images and use the html lowsrc attribute:
 wrote:
> Dear all,
>
> I'm currently developing an online catalog using
> JSP. People can upload
> images of any sizes to our catalog. I need a program
> which my jsp can call
> to generate a thumbnail out of the uploaded
> images(jpg or gif). Would
> appreciate it if you can point me to where I can get
> this component. I've
> come across some freeware but they have GUI. I need
> the API. Thanks much.
>
> kim.
>
> - Original Message -
> From: "aytekin_umit" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, October 24, 2000 11:10 PM
> Subject: refresh page problem
>
>
> > Hi. I created a jsp that shows a persons' profile
> data.
> >
> > I take the user data from database and show it to
> the user.
> > If the user wants to change its data i take the
> new data and
> > update the user profile.
> >
>
-
> > if(mode==showuserprofile)
> > {
> > create html with required data
> > }
> > else if(mode==update user profile)
> > {
> > update user data in the database
> > and create html with required data
> > }
> >
>

> > I dont let the jsp to cached
> > The problem i am having is that if the back or
> forward buttons of
> > the browser is clicked the browser gives en error
> that it needs
> > refresh.I dont want that "refresh" need to occur
> but instead let the
> > user go back or forward without clicking the
> refresh button of the
> > browser.Is there a way to accomplish this?
> > Thanks
> >
> >
> >
> > __
> > ÜCRETSÝZ E-MAIL ALDINIZ MI?
> > Türkçe ilk Portal  http://www.mynet.com
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Uploading file

2000-10-20 Thread Ron Chan

Hi,

http://technet.oracle.com/doc/java.815/a64685/basic4.htm#1002507

ron


--- Antonio Jimenez <[EMAIL PROTECTED]> wrote:
> the solution is LONG RAW Oracle datatype
>
> Cheong Takhoe wrote:
> >
> > Hi,
> >
> > I'm trying to achieve the method above with Oracle
> and it works ...
> > but only for files less than 5k
> >
> > This is what I get when it fails..
> > sql.SQLException: ORA-01461: can bind a LONG value
> only for insert into a
> > LONG column
> >
> > I need help here because I intend to store media
> files...
> > hows the solution to store files bigger than 5k?
> >
> > regards,
> > Cheong Takhoe
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> --
> Antonio Jimenez Alfaro
> Departamento Tecnico
>
-
> Internet Systems S.A.
> mailto:[EMAIL PROTECTED]
> Doctor Esquerdo, 10 4ª planta
> http://www.intersys.es
> 28028 MADRID  Tel. +34
> 914.013.325
> SPAIN Fax  +34
> 914.015.689
>
-
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: string in javascript

2000-10-20 Thread Ron Chan

Hi,

this comes to mind but is probably not the correct
way!

StringTokenizer st = new StringTokenizer( s, "\n" );
String ss = "";
while( st.hasMoreTokens() ) {
  ss += st.nextToken() + "";
}

something like that, then show ss in the jsp.

ron



--- david chan <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a JSP that retrive a string from database,
> the string may contain
> anykind of char. The problem is that when I assign
> the string to a variable
> in javascirpt then send this javascript code to
> browser, some special char.
> in the javascript will cause problem, i.e. the new
> line char. will cause the
> javascript variable broken.
> I can't use URLencode in here because I don't want
> to show the encoded
> string as plain text on browser. what i want is to
> have a mapping from char.
> to HTML sytax, i.e. new line will map to .
> Does anyone have sample code for this ?
> Thanks.
> David
>
>
_
> Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com.
>
> Share information about yourself, create your own
> public profile at
> http://profiles.msn.com.
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Output-Stream for logging

2000-10-13 Thread Ron Chan

Hi,

maybe this will work for you:

If you already have println everywhere, the simplest
is to pipe > it to a log.dat file. then use "tail -f
log.dat" to monitor the log.

ron


--- Stefan Henke <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to integrate a logfile into my webapp to
> write some info to (e.g. if
> an exception is thrown). I used a stream which
> should be stored in a file.
> I thought of opening a PrintWriter and add it to the
> session-objects.
> But I think this is no good idea because there is a
> multi-user access to the
> file and the streams is only written to the file if
> I close the stream.
>
> Does anybody has a better solution?
>
> Thanks
> Stefan
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Tracking user visit

2000-10-09 Thread Ron Chan

Hi,

1. have the servlet note every doGet and doPost.
2. create a database table to store the information
above about which page the user has visited; also
store other information like timestamp etc.
3. use a report writer to report on the table.

One can get alot of information on user behaviour
without much overhead at runtime.

ron

ps. as for a counter, do a select on all the 'login'
actions. this will give you a count of the number of
visitors. then display this on your jsp page.

--- Rathna <[EMAIL PROTECTED]> wrote:
> hi sanjay,
>
> you could store the counter variable into the
> session
> so that the counter variable will be assocoated with
> the
> pariticular user.
>
> hope this helps,
>
> with regards,
>rathna.
>
>
> Sanjay Vashisht wrote:
>
> > Hi All
> > Can I track the user visiting different pages in
> the following manner:-
> >
> > 1.No. of times user visit a particular page
> > 2.If there are 100 users , how to keep track that
> which user has visited
> > which page , how many number of times.
> >
> > If there will be a counter variable for each user
> how do i use that
> > variable and how? Suggestions welcome.
> >
> > Regards
> > Sanjay
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Need some ideas on JSP, JavaBeans and JDBC

2000-10-03 Thread Ron Chan

Hi,

I use a bean that returns a DefaultTableModel that
holds the data from iterating through the result set.

ron

--- Ryan Richards <[EMAIL PROTECTED]> wrote:
> I have written a small app that uses the Factory
> pattern to
> create object via a Factory class. I have a jsp that
> calls
> this class to add a user or delete a user from an
> Oracle
> database. My question is as follows:
>
> Consider this scenario: I would like to list all
> users in
> an HTML table, each user in it's own row. Hence I
> would
> create a table in the JSP and somehow iterate thru
> the
> ResultSet from the db to insert each username into
> the
> table cell. My problem is that I am not sure what
> the best
> approach to this would be while trying to keep the
> code in
> the JSP at a minimum. I figured I could I return a
> result
> set to the JSP and iterate thru it there but didnt
> think
> this would be the best way.
>
> Thanks for any ideas.
>
> Ryan
>
___
> Visit http://www.visto.com/info, your free web-based
> communications center.
> Visto.com. Life on the Dot.
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: To: Sufi "ASK ANYTHING" Malak

2000-10-02 Thread Ron Chan

Hi all,

what is the point of the subject line if no one
follows it. create a forum "anything java" or the like
if you like all that free form approach.

I refuse to help those who do not seem like they are
helping themselves. I tell myself if everyone who
knows and ignores these postings, no such postings
will be encouraged.

On the otherhand, the next best thing to knowing is
knowing where to find it. Rather than getting mad,
make them work a little by pointing them to the right
places but spoon feed the answers. This should be done
off line lest you add to 'nuisance' postings almost as
bad as the original (which of course, this is!).

ron


--- Martin Cooper <[EMAIL PROTECTED]>
wrote:
> No. People like Sufi don't deserve a break. It's
> people like them that cause
> thousands of people to have to wade through hundreds
> of off-topic messages
> every week. If time is money, how much do you think
> all that wasted time
> might be worth?
>
> If all the questions on this list were specifically
> related to JSP, this
> list would be much healthier than it is today. If
> nothing else, the people
> who have abandoned the list as no longer worthwhile
> might still be here, and
> there might be some interesting design discussions
> going on, instead of a
> constant blizzard of guff with a few nuggets hiding
> in it. The average
> reader would learn more from the average posting to
> the list.
>
> If I want to read about JDBC, SQL, JavaScript or
> HTML, I'll look for a
> suitable source of information. I won't just assume
> that there must be
> someone out there who has the same overlap in
> interests as me, and assume
> that the other thousands of people won't mind my
> butting in on their
> conversations to ask my off-topic questions.
>
> But perhaps that's just me. Perhaps the Sufi's of
> the world haven't heard of
> common courtesy.
>
> - Original Message -
> From: "Tom Preston" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 02, 2000 7:43 AM
> Subject: Re: To: Sufi "ASK ANYTHING" Malak
>
>
> > Guys,  get over yourselves.  Give Sufi a break.
> If the only questions
> > asked in this
> > forum were JSP specification questions, the list
> be almost non-existent.
> >
> > SQL, Java, Javascipt, HTML, and app servers are
> all part of practical
> > jsp programming.
> >
> > >I ran a search on the mail I've received from
> this list, and to my
> > surprise
> > >found over 50 answers generated by your
> questions. Quite an achievement
> > in a
> > >period of just two months. The range of subjects
> is also quite
> > impressive,
> > >you seem to be interested in JSP, Java,
> Javascript , several servers,
> > HTML
> > >and SQL, to name a few. Sending us complete
> samples of your code is a
> > nice
> > >gesture, but unfortunately there always seems to
> be a problem with it.
> > >
> > >It would be nice if you would post your questions
> on these subjects to
> > >appropriate lists elsewhere. Reading some manuals
> could also help
> > before
> > >asking a question, see the list for some ideas.
> > >
> > >Thanks in advance for your cooperation.
> >
> >
> >
> > --
> > Tom
> >
> >  --
> > | Thomas Preston   |
> > | Vacation.com, Inc.   |
> > | Engineering Department   |
> > | 617.654.8432 |
> > | http://www.vacation.com  |
> >  --
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Dictionary help please!

2000-09-01 Thread Ron Chan

Hi,

a dictionary is a hash table, ie. items stored are
hashed and their order changes with insertion and
removal of items in the collection.

having said that, I have an 'ordered' hashtable. it
retains the advantages of the hashtable, yet you are
able to get the items like a vector. quite convenient
in many circumstances.

ron


--- Angela Chow <[EMAIL PROTECTED]> wrote:
> hi,
>
> I need someone to give me some info on how
> dictionary
> works.  I know that it holds a stack of objects with
> a
> key associating with its value.  What is the order
> of
> the stack?  Is it first in, last out?  Is there
> anyway
> that i could reverse the order of the stack?
>
> thanks in advance!
>
> angela
>
> __
> Do You Yahoo!?
> Yahoo! Mail - Free email you can access from
> anywhere!
> http://mail.yahoo.com/
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: SV: what's wrong with this JSP file ? Urgent Please

2000-08-15 Thread Ron Chan

Hi,

isn't the following what you want?

int n = rs.getInt( 1 );
boolean b = rs.wasNull();

ron



--- Magnus Walter <[EMAIL PROTECTED]>
wrote:
> Change the SQL statement, configure the table to use
> default values, use
> some JavaScript to check the form values before
> submitting will all FIX the
> problem BUT !
>
> Can I check/handle NULL values in a recordset using
> JAVA (JDBC-ODBC) ?
>
> Example:
> I have a .jsp page for list all messages from table:
> tbl_msg (name
> varchar(50),title varchar(100),msg text). Column msg
> may include null
> values. If it find a null value in the msg column it
> will show nothing or do
> some spec. action like include another .jsp page
> ...
>
> Enviroment:
> Wint NT, MS SQL Server 7.0, Tomcat 3.1 ...
>
> So  is it possible to check for null values in
> java, or handle null
> values before the error ?
>
> I'm very gratefull for all help !
>
> /Mange
>
> -Ursprungligt meddelande-
> Från:   Selvamani Jayakumar
> [SMTP:[EMAIL PROTECTED]]
> Skickat:den 14 augusti 2000 20:52
> Till:   [EMAIL PROTECTED]
> Ämne:   Re: JDBC-ODBC and NULL
>
> hi
>
> you can change the SQL statement to avoid
> null. Check the fields
> which will be null and replace with space.
> You can use
> the NVL funct in Oracle and ISNULL funct in
> SQL Serv.
> By this way you can avoid null values before
> getString.
> It doesnt chnge your database values too.
>
>
>
>
>
> >From: Magnus Walter
> <[EMAIL PROTECTED]>
> >Reply-To: A mailing list about Java Server
> Pages specification and
> > reference <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: JDBC-ODBC and NULL
> >Date: Mon, 14 Aug 2000 13:58:51 +0200
> >
> >Hi,
> >need help with JDBC-ODBC and NULL values ?
> >
> >When I use getString and the value is null
> I got a ugly ERROR ! Is
> it
> >possible to check for NULL values before i
> use getString ?
> >(getString will give me the error so the
> method wasNull() dont
> help)
> >
> >Please help !
> >( I dont want to change the database and
> its null values)
> >
> >/Mange
> >
>
>
>===
> >To unsubscribe: mailto
> [EMAIL PROTECTED] with body: "signoff
> >JSP-INTEREST".
> >Some relevant FAQs on JSP/Servlets can be
> found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >
> http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
>

> Get Your Private, Free E-mail from MSN
> Hotmail at
> http://www.hotmail.com
>
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED]
> with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be
> found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: bit off topic - HELP on books

2000-08-14 Thread Ron Chan

Hi,

ed roman's ejb book is available:
http://www.interpasnet.com/JSS/index.htm?id=11

wrox's prof jsp is good.

ron


--- Abudhahir A <[EMAIL PROTECTED]> wrote:
> Thanks Patrick.
>
> - Original Message -
> From: Patrick Buchanan <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, August 15, 2000 12:49 AM
> Subject: Re: bit off topic - HELP on books
>
>
> > A very good book on JSP's is "Web Development with
> JavaServer Pages" by
> Duane K.
> > Fields and Mark A. Kolb, Manning publishing.
> >
> > Another is "Core Servlets adn JavaServer Pages" by
> Marty Hall, Sun
> publishing
> >
> > Another very popular book is "Java Servlet
> Programming" by Jason Hunter,
> > O'Reilly publishing . . . it's the one with the
> tea/coffee kettle on the
> front.
> >
> > hope that helps,
> >
> > pat
> >
> >
> >
> >
> >
> > Abudhahir A <[EMAIL PROTECTED]> on 08/14/2000
> 03:05:51 PM
> >
> > Please respond to A mailing list about Java Server
> Pages specification and
> >   reference <[EMAIL PROTECTED]>
> >
> > To:   [EMAIL PROTECTED]
> > cc:(bcc: Patrick Buchanan/CFC)
> >
> > Subject:  bit off topic - HELP on books
> >
> >
> >
> >
> > hi guys there
> > I want to equip as you guys are can any body
> suggest good book on
> > 1. Web Sphere
> > 2. Web Logic
> > 3. EJB
> > 4. Servlets & JSP
> > Thanks for your time and guidance
> >
> > abudhahir
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > "This may contain information that is confidential
> or privileged. If you
> are not
> > the addressee indicated in this message (or
> responsible for delivery of
> this
> > message to such person), you should not  copy or
> deliver this message to
> > anyone or make any other use of the information
> set forth herein.  In such
> > case, you should destroy this  message and notify
> the sender by telephone
> > or e-mail."
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Problem with Date object in jsp

2000-08-13 Thread Ron Chan

Hi,

cannot say I understand your statement about "cannot
go to the timestamp format", but

1. are you using java.util and java.sql Dates
correctly?
2. you can always new Timestamp( d.getTime().getTiem()
) to create a Timestamp if all else fails!
3. If you are using Oracle, I believe timestamp is
really used and not a date.

ron


--- Ishfaq Ahmed Lone <[EMAIL PROTECTED]>
wrote:
> I am passing a date value(Date object) from a jsp to
> a bean(session) method
> ,but it is giving IllegalArgumentEexception , asking
> for the Timestamp
> object format, even though my bean method has a Date
> field argument.
>
> i cant go to the timestamp format,  Can anyone help
> me out how to make it
> work with Date object only.
> Thanx in advance
>
***
> Ishfaq Ahmad Lone
>
>
***
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: DB Access problem

2000-08-09 Thread Ron Chan

Hi,

to get the count:

String query = "SELECT count(*) FROM EMPLOYEE where
FIRST_NAME='first'";
while (rs.next())
{
  int i = rs.getInt( 1 );
  System.out.println( "i: " + i );
...

ron

--- Tarik Makota <[EMAIL PROTECTED]>
wrote:
> OK
> I found a problem,
>
> It seams that my ODBC version somehow has a glitch
> so i need to update it.
> My Sybase ASA connection via JDBC:ODBC is OK but
> Microsoft based databases
> are failing.
> However is there a wayy in Jav ato do something
> like:
>
> String validate = "SELECT count(*) FROM security
> WHERE username = '" +
> userName +"'"
> Statement stmt = con.createStatement();
> integer CountIt= stmt.execute(validate);
>
> or do i have to use getUpdateCount()  and if Yes
>
> would this be correct syntax?
>
> String validate = "SELECT count(*) FROM security
> WHERE username = '" +
> userName +"'"
> Statement stmt = con.createStatement();
> ResultSet rs = stmt.execute(validate);
> integer count = stmt.getUpdateCount();
> if (count > 0) {
> Yipi.
> else
> buuu--hh
> end if
>
>
>
>
>
> Thanks guys.
>
>
> - Original Message -
> From: Tarik Makota <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, August 09, 2000 2:06 PM
> Subject: Re: DB Access problem
>
>
> > I changed odbc from CoffeePot to NorthWind (MSSQL
> 7.0)
> > I have DSN under System and can access it from
> PowerBuilder so it works.
> >
> > This is the error i get when i run .jsp
> >
> > java.sql.SQLException: [Microsoft][ODBC SQL Server
> Driver]Invalid
> Descriptor
> > Index
> >
> >
> >
> > - Original Message -
> > From: Matthews,Paul <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, August 09, 2000 12:45 PM
> > Subject: Re: DB Access problem
> >
> >
> > > silly question- should that be 'CoffeePot' in
> the url?
> > >
> > > also call getConnection(url); rather than
> passing empty
> username/password
> > >
> > > regards, paul
> > >
> > > > -Original Message-
> > > > From: Tarik Makota
> [mailto:[EMAIL PROTECTED]]
> > > > Sent: 09 August 2000 17:37
> > > > To: [EMAIL PROTECTED]
> > > > Subject: DB Access problem
> > > >
> > > >
> > > > This is my acctual bean that is supposetly to
> connect to DB:
> > > > I put the 'markers' so that i know where it
> stops.
> > > >
> > > > As soon as it hits Connection conn = ... it
> stops
> > > > because in my jsp page print the propert
> userName
> > > > so that i know wher do i get stuck.
> > > > JSP page is displayed without any errors
> > > >
> > > >
> > > > My DSN  is ok because i have tried User and
> System.
> > > >
> > > >
> > > >
> > > >
>
--
> > > > package foo;
> > > > import java.util.*;
> > > > import java.sql.*;
> > > > import java.net.URL.*;
> > > >
> > > >
> > > > public class DBLoginBean6{
> > > >  private boolean isValid = false;
> > > >  private String userName;
> > > >  private String userPassword;
> > > >
> > > >  public DBLoginBean6() {
> > > >  userName="Initalized";
> > > >  userPassword="";
> > > >  String url = "jdbc:odbc:CofeePot";
> > > >  String query = "SELECT * FROM EMPLOYEES";
> > > >  String firstName;
> > > >  String lastName;
> > > >  boolean more;
> > > >  try
> > > >  {
> > > >   userName="First Try";
> > > > try{
> > > >
> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> > > >   }
> > > >   catch (java.lang.ClassNotFoundException ex)
> > > >{
> > > >   ex.printStackTrace();
> > > >   }
> > > >   userName=" connection begin";
> > > > Connection con =
> DriverManager.getConnection(url,"","");
> > > > userName="I connected";
> > > > Statement stmt =
> con.createStatement();
> > > >   userName="i created statement";
> > > > ResultSet rs =
> stmt.executeQuery(query);
> > > > userName="i executed statement";
> > > > while (more = rs.next())
> > > > {
> > > >  firstName =
> rs.getString("FIRSTNAME");
> > > >  lastName =
> rs.getString("LASTNAME");
> > > >  System.out.println( firstName + "
> " + lastName);
> > > >  userName = "I was executed";
> > > > }
> > > >   userName="I did while";
> > > > rs.close();
> > > > stmt.close();
> > > > con.close();
> > > > userName="And i ewxited";
> > > >  }
> > > >  catch (SQLException ex)
> > > >   {
> > > >   ex.printStackTrace();
> > > >  }
> > > >
> > > >
> > > >
> > > >  }
> > > >
> > > >  public String getuserName() {
> > > >return userName;
> > > >  }
> > > >  public String getuserPassword() {
> > > >return "I am user Password";
> > > >  }
> > > >
> > > >  }
> > > > 
> > > >
> > > >
>
==
> > > > =
> > > > To unsubscribe: mailto [EMAIL PROTECTED]
> with body:
> > > > "signoff JSP-INTEREST".
> 

Re: DB Access problem

2000-08-09 Thread Ron Chan

Hi,

I ran your code with slight changes and it works. I
suggest you look at the odbc configuration.

ron

modified code below. if you set break points inside
the rs.next loop you will see the names.


import java.util.*;
import java.sql.*;
import java.net.URL.*;

public class DBLoginBean6{
 private boolean isValid = false;
 private String userName;
 private String userPassword;

 public static void main( String[] args ) {
   DBLoginBean6 db = new DBLoginBean6();
   System.out.println( "n " + db.userName );
 }
 public DBLoginBean6() {
 userName="Initalized";
 userPassword="";
 String url = "jdbc:odbc:d003";
 String query = "SELECT * FROM EMPLOYEE";
 String firstName;
 String lastName;
 boolean more;
 try
 {
userName="First Try";
try{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (java.lang.ClassNotFoundException ex)
{
  ex.printStackTrace();
}
userName=" connection begin";
Connection con =
DriverManager.getConnection(url,"","");
userName="I connected";
Statement stmt = con.createStatement();
userName="i created statement";
ResultSet rs = stmt.executeQuery(query);
userName="i executed statement";
while (rs.next())
{
 firstName = rs.getString("FIRST_NAME");
 lastName = rs.getString("LAST_NAME");
 String s = firstName + " " + lastName;
 System.out.println( s );
 userName = s + " was executed";
}
userName="I did while";
rs.close();
stmt.close();
con.close();
userName="And i ewxited";
 }
 catch (SQLException ex)
  {
  ex.printStackTrace();
 }
 }

 public String getuserName() {
   return userName;
 }
 public String getuserPassword() {
   return "I am user Password";
 }
}



--- Tarik Makota <[EMAIL PROTECTED]>
wrote:
> This is my acctual bean that is supposetly to
> connect to DB:
> I put the 'markers' so that i know where it stops.
>
> As soon as it hits Connection conn = ... it stops
> because in my jsp page print the propert userName
> so that i know wher do i get stuck.
> JSP page is displayed without any errors
>
>
> My DSN  is ok because i have tried User and System.
>
>
>
>
--
> package foo;
> import java.util.*;
> import java.sql.*;
> import java.net.URL.*;
>
>
> public class DBLoginBean6{
>  private boolean isValid = false;
>  private String userName;
>  private String userPassword;
>
>  public DBLoginBean6() {
>  userName="Initalized";
>  userPassword="";
>  String url = "jdbc:odbc:CofeePot";
>  String query = "SELECT * FROM EMPLOYEES";
>  String firstName;
>  String lastName;
>  boolean more;
>  try
>  {
>   userName="First Try";
> try{
>
> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>   }
>   catch (java.lang.ClassNotFoundException ex)
>{
>   ex.printStackTrace();
>   }
>   userName=" connection begin";
> Connection con =
> DriverManager.getConnection(url,"","");
> userName="I connected";
> Statement stmt = con.createStatement();
>   userName="i created statement";
> ResultSet rs = stmt.executeQuery(query);
> userName="i executed statement";
> while (more = rs.next())
> {
>  firstName = rs.getString("FIRSTNAME");
>  lastName = rs.getString("LASTNAME");
>  System.out.println( firstName + " " +
> lastName);
>  userName = "I was executed";
> }
>   userName="I did while";
> rs.close();
> stmt.close();
> con.close();
> userName="And i ewxited";
>  }
>  catch (SQLException ex)
>   {
>   ex.printStackTrace();
>  }
>
>
>
>  }
>
>  public String getuserName() {
>return userName;
>  }
>  public String getuserPassword() {
>return "I am user Password";
>  }
>
>  }
> 
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/f

Re: Free MSQLS Server JDBC driver

2000-08-08 Thread Ron Chan

Hi,

try:

http://www.freetds.org/

ron



--- Oscar_Silván <[EMAIL PROTECTED]> wrote:
> Does any one know how can i get a free JDBC type 4
> driver for Microsoft SQL
> server 7.0?
>
> Thanks to all.
>
>
> Oscar Silván Oró
> Globaliza Network, S.A.
> Telf.: 91 351 39 69
> Fax: 91 351 37 13
> E-mail: [EMAIL PROTECTED]
> Web: http://www.globaliza.com
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Refreshing Page after few minutes

2000-08-04 Thread Ron Chan

Hi,

try:

 res.setHeader( "Refresh", "300" );

ron


--- Sumit Honwad <[EMAIL PROTECTED]> wrote:
> Hello Experts,
>
> Can anyone tell me how can i refresh my page say
> after 4-5 minutes
>
> Regards
> Sumit
>
>
>
>
>
> >From: "Hensley, Zachary"
> <[EMAIL PROTECTED]>
> >Reply-To: A mailing list about Java Server Pages
> specification and
> > reference <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: Expiring page
> >Date: Fri, 4 Aug 2000 14:39:42 -0400
> >
> >Well Said
> >
> >-Original Message-
> >From: Julia Reynolds
> [mailto:[EMAIL PROTECTED]]
> >Sent: Friday, July 21, 2000 8:48 AM
> >To: [EMAIL PROTECTED]
> >Subject: Re: Expiring page
> >
> >
> >What's the point of this post, Jim?  You haven't
> had a chance to be snide
> >today, so
> >
> >you're taking it out on this mailing list?  Perhaps
> it would be more useful
> >to the
> >original poster to suggest that he check out
> Javascript options like
> >removing the
> >toolbar altogether, and providing his own
> navigation buttons.
> >
> >  I've subscribed to a number of mailing
> lists, and I have never seen
> >such a
> >large number of rude and arrogant responses to
> beginner's questions.  If
> >you
> >are
> >too good or too important to be civil, then
> unsubscribe to this list.  With
> >responses like this one, you aren't helping anyone,
> anyway.
> >
> >
> >Julia
> >
> >
> >Jim Preston wrote:
> >
> > > There are some things in life that you just
> can't control and can't have
> >the
> > > way you want, period, no matter how much you may
> want it. This rule
> >applies
> > > to most subsets of life, including software
> engineering. This is one of
> > > those things. You just don't have that much
> control over the browser.
> >Live
> > > with it. (One is tempted to ask why you so
> adamantly want to force a
> >blank
> > > page on your users, especially when all they
> would have to do is hit the
> > > Reload button anyway, but I've learned that
> asking such questions is as
> > > pointless as trying to get total control of the
> browser.)
> > >
> > > --Jim Preston
> > >
> > > 
> > > Personally, if I put on my user hat, I don't
> want "those engineers" to
> >have
> > > that kind of control over my browser. Who the
> heck are you to tell me
> >that
> >I
> > > can't go back and view a previous page when I
> want to?
> > > 
> > >
> > > -Original Message-
> > > From: A mailing list about Java Server Pages
> specification and reference
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of
> Mahesh Kuklani
> > > Sent: Thursday, July 20, 2000 10:18 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Expiring page
> > >
> > > With this i get my page refreshed ,i do not want
> the page to get
> >reloaded
> >i
> > > want it to do nothing i.e. show a blank page if
> i go back.
> > >
> > > Mahesh.
> > >
> > > -Original Message-
> > > From: Manisha Sharma
> [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, July 20, 2000 11:51 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Expiring page
> > >
> > > Some one had posted this in the forum before.
> Try it.
> > >
> > > Set these headers:
> > > response.setHeader("Cache-Control", "no-cache");
> > > response.setHeader("Pragma", "no-cache");
> > > response.setHeader("Expires", "-1");
> > >
> > > And put this in the  tag of your page
> > >  content="no-cache">
> > >
> > > -Original Message-
> > > From: Mahesh Kuklani
> [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, July 20, 2000 3:46 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Expiring page
> > >
> > > Hi all,
> > >How do i expire a page i.e. if the user
> clicks on back button he
> > > shouldn't be able to see anything. I am using
> > >
> > > 
> > > 
> > >  content="Tue, 20 Aug 1996 14:25:27
> >GMT">
> > > 
> > >
> > > in jsp but it's not working.
> > >
> > > Thanks in advance.
> > >
> > > Mahesh.
> > >
> > >
>
>===
> > > To unsubscribe: mailto [EMAIL PROTECTED]
> with body: "signoff
> > > JSP-INTEREST".
> > > Some relevant FAQs on JSP/Servlets can be found
> at:
> > >
> > >  http://java.sun.com/products/jsp/faq.html
> > >  http://www.esperanto.org.nz/jsp/jspfaq.html
> > >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> > >
> > >
>
>===
> > > To unsubscribe: mailto [EMAIL PROTECTED]
> with body: "signoff
> > > JSP-INTEREST".
> > > Some relevant FAQs on JSP/Servlets can be found
> at:
> > >
> > >  http://java.sun.com/products/jsp/faq.html
> > >  http://www.esperanto.org.nz/jsp/jspfaq.html
> > >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> > >
> > >
>
>===
> > > To unsubscribe: mailto [EMAIL PROTECTED]
> with body: "signoff
> > > JSP-INTEREST".
> > > Some relevant FAQ

Re: static initialiser block in JSP page

2000-08-03 Thread Ron Chan

Hi,

take a look at the Singleton pattern.

ron


--- Oren Klichevsky <[EMAIL PROTECTED]>
wrote:
> I think that you should approach the problem from
> another direction.
> Create a bean that will do all the initilization of
> the Hashtable on it's
> instantiation.
> After that use your bean with the "application"
> scope within your JSP files.
> This will assure you that this bean will be
> inistantiated only one time for
> the whole application. After doing that you will be
> able to use all the
> regular bean syntax of JSP to access it's data.
>
>
> Best Regards,
> Oren Klichevsky
> www.mannainc.com 
>
>
>
> -Original Message-
> From: A mailing list about Java Server Pages
> specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Dowd, Brian
> Sent: Thursday, August 03, 2000 6:12 PM
> To: [EMAIL PROTECTED]
> Subject: static initialiser block in JSP page
>
>
> HI All,
>I'm trying to get a static initializer in my JSP
> page (such that it will
> only ever populate
> a hashtable once in the java file generated).
> Something *like* this :
>
> <%!
> String code = "X";
>
>// static initialiser block to construct
> hashtable (once ever).
>static {
> Hashtable months = new Hashtable();
> // These values come from the region
> table in ARM.
> regions.put("0", "January");
> regions.put("2", "February");
>
> //  etc
>
>}
>
> %>
>
>
> <%
>  // Use a month
> out.println("Jan=" + (String) regions.get("1"));
>
> %>
>
>
> It works if I move it out of the <%! .. %> tags and
> make it a non static,
> but the
> point is I want it to be static  has anyone done
> anything similar ?
>
> Cheers,
> Brian.
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: date formate fectching??dd/mm/yyyyy

2000-08-03 Thread Ron Chan

Hi,

try something like this:


import java.util.*;
import java.text.*;

public static void main( String[] args )
{
 String s = args[ 0 ];
 SimpleDateFormat sf = new SimpleDateFormat(
"-MM-dd" );
 ParsePosition pos = new ParsePosition(0);
 Date d = sf.parse( s, pos);
 sf = new SimpleDateFormat( "dd-MM-" );
 s = sf.format( d );
 System.out.println( "s " + s );
}


ron


--- subramanian Athimoolam <[EMAIL PROTECTED]>
wrote:
> hi
>
> how can i fetch date formate like mm/dd/yy
> in jsp page.
> here i am using java.util.date df=rs.getDate(1);
>
> it will be displaying 2000-08-03
>
> i want to display 03-08-2000
>
> how can i do it
> thanks
>
> [ in oracle to_char('df','dd/mm/ ') its working
> but how can i implement
> in jsp??  ]
>
> subu
>
>
>

> Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: How can I schedule a Job in JSP or servlet...

2000-08-03 Thread Ron Chan

Hi,

http://java.sun.com/docs/books/tutorial/uiswing/misc/timer.html

maybe useful.

ron


--- Jim Preston <[EMAIL PROTECTED]> wrote:
> No offense intended, but some of the proposed
> solutions to this simple query
> strike me as falling into the "shooting flies with a
> battleship" category;
> you're making it much more complicated than it needs
> to be. And those
> proposing using Cron or JRunScheduler are then
> locked into a particular
> platform.
>
> Why not write a pure Java solution, and let the
> built-in Java mechanisms do
> your timing for you? The sleep method of the Thread
> class takes a duration
> as the parameter. When your servlet/JSP first starts
> up, spawn a thread as
> Krishnan suggested. Rather than spend overhead
> waking up periodically to
> check for the right time, this thread just does a
> simple subtraction to
> calculate how long between "now" and the next time
> you want to do your
> operations, then calls sleep for that duration. When
> it wakes up, it does
> its work, then calculates how long until the next
> wakeup time, and sleeps
> for that duration. A single sleeping thread really
> doesn't take up much in
> the way of resources, so there's no reason you can't
> just leave this thread
> "running" all the time.
>
> Simple, elegant, platform-independent, very low
> resource usage.
>
> --Jim Preston
>
>
> -Original Message-
> From: A mailing list about Java Server Pages
> specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Krishnan
> Sent: Wednesday, August 02, 2000 5:31 AM
> To: [EMAIL PROTECTED]
> Subject: How can I schedule a Job in JSP or
> servlet...
>
>
> Hi pals,
> We have to run a servlet or JSP automatically on
> saturday night at 12. We
> are planning to write a servlet and in the init
> method of that servlet,
> planning to invoke a thread which checks for the
> specified time and if
> satisfies, do the necessary operations. We will load
> that servlet at startup
> of the server. I want to know, is there is any other
> possible way of
> achieving the same.
> Your replies are highly appreciated.
>
> rgds
> krishnan
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: JSP-Bean question

2000-08-02 Thread Ron Chan

Hi,


1. did you really put an _ in the file name?
2. is the class file named the same as the file name,
should be other wise it cannot compile. So it is
either no _ or has an upper case 'S'.
3. you should package your class and place it in its
directory in the recommended place by the vendor. if
not, make sure your classpath is set correctly.

ron


--- Bains Rupali <[EMAIL PROTECTED]> wrote:
> You dont need to register the bean. Did you place
> the bena in the
> myserver/serverclasses directory?
>
> -Rupali
>
> -Original Message-
> From: Mark Annese [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 02, 2000 1:13 PM
> To: [EMAIL PROTECTED]
> Subject: Re: JSP-Bean question
>
>
> I have checked the classname and it is consistant
> with the code in the
> class, the classname, filename, and alias name that
> I registered in
> Weblogic...I am confused .
>
> -Original Message-
> From: A mailing list about Java Server Pages
> specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Sicaud Patrice
> Sent: Wednesday, August 02, 2000 10:54 AM
> To: [EMAIL PROTECTED]
> Subject: Re: JSP-Bean question
>
>
> is your class name accurate?
>
> -Original Message-
> From: Mark Annese [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 02, 2000 9:05 AM
> To: [EMAIL PROTECTED]
> Subject: JSP-Bean question
>
>
> I have created a small bean and I am trying to
> access it through a JSP. I am
> using Weblogic as my server. I registered the
> bean(did not know if I had to,
> but did anyway) and placed it in my classpath. when
> I run the JSP I get an
> error reading:
>
>
C:\weblogic\myserver\classfiles\jsp_servlet\_stringbean.java:73:
> cannot
> resolve symbol
> probably occurred due to an error in /StringBean.jsp
> line 10:
> 
>
> Any ideas on what I did wrong?
>
> Thanks!
>
> Mark
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: problem in JSP compilation when beans are used

2000-07-14 Thread Ron Chan

Hi,

on first glance, one problem will be that a bean needs
a null constructor.

ron


--- Syamala kotamraju <[EMAIL PROTECTED]>
wrote:
> Hi,
>
>  Here's the code for testBeans.jsp file
> 
> 
> 
> 
> Testing Beans
> 
> 
>
> <%@page import = "test.*" %>
>  scope="request">
>  value = "Hello world" />
>   The Message is  property = "msg" />
> 
> 
> 
>
> And the code for testBean.java which is under the
> directory test:
> package test;
>
> public class testBean
> {
>   private String msg = " No message";
>   public void setMsg(String msg)
>   {
> this.msg = msg;
>   }
>   public String getMsg()
>   {
> return(msg);
>   }
> }
> I placed my testBean.class file in the directory:
> c:\javawebserver2.0\classes\test
> and my jsp file in the directory
> c:\javawebser2.0\public_html
>
> Thanks,
> Syamala
> > - Original Message -
> > From: [EMAIL PROTECTED]
> > To: [EMAIL PROTECTED]
> > Received: 07/14/2000  09:31 AM
> > Subject: Re: problem in JSP compilation when beans
> are used
> >
> > hi
> >
> > check your close bracket proberly. other wise send
> your full code. then only
> > i came to know!!
> >
> >
> >
>

> > Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
>
>
>
>
>
>
>
>
>
>
> Get your own Free Unified Messaging email account
> (with toll-free voicemail and fax!) at
> http://www.electronmail.com
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Get Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: how to detect a browser closing

2000-07-10 Thread Ron Chan

Hi all,

see if 'stale connections' in J.Hunter's book is what
you want.

ron


--- "Cogley, Jonathan"
<[EMAIL PROTECTED]> wrote:
> Jeff,
>
> What you described sounds similar to
> Response.IsClientConnected() in ASP
> which returns whether or not the client is still
> connected (JSP has
> something similar??)
> but I think the poster wants to determine if/when
> the user closes the
> browser once
> the page has already downloaded
>
> I think some more info from the poster on what he is
> trying to achieve
> would help ... Ionel ??
>
> Cheers,
> Jonathan
>
>
> -Original Message-
> From: Steiner, Jeff [mailto:[EMAIL PROTECTED]]
> Sent: 10 July, 2000 2:02 PM
> To: [EMAIL PROTECTED]
> Subject: Re: how to detect a browser closing
>
>
> There is a way to do this, but I am at a loss as to
> the actual package that
> does it.  Basically, you would use the call if doing
> a vary hard processing
> page and want to make sure before trying to send it
> back to make sure they
> are still present.  It does some sort of a ping of
> the client machine to
> make sure it is responding and then sends out the
> information.
>
> I hope this helps to clarify for someone else
> thatcan remember the package.
>
> Jeff Steiner
>
> -Original Message-
> From: Shane Duan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 10, 2000 10:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: how to detect a browser closing
>
>
> Since a server is a program that takes request and
> send response, and
> that the Internet connection is stateless, I don't
> think you can use the
> server to detect when the browser is closed.
>
> The only way I know would be to set a time out on
> the session and do the
> logic when the session time out occurs.
>
> Hope that helps.
>
> Shane Duan
> [EMAIL PROTECTED]
>
>  -Original Message-
> From:   Ionel Condor [mailto:[EMAIL PROTECTED]]
> Sent:   Monday, July 10, 2000 7:22 AM
> To: [EMAIL PROTECTED]
> Subject:how to detect a browser closing
>
> Hi,
> I have the following problem:
> I want to detect on the server side when a user
> (which has an open
> session on the server) has closed his browser by
> pressing the "X" close
> button of the window.
> I know that using http sessions is probably the
> unique way, but I don't
> know how, as I
> don't know if the server can't initiate by itself
> such a check ?
>
> Many thanks for any suggestions,
> Ionel C.
>
>

> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Get Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Oracle Stored Procedure from JSP

2000-06-28 Thread Ron Chan

Hi,

Sun has a book on Java JDBC/ODBC that is very good.
take a look.

ron


--- Mutahar Qayum <[EMAIL PROTECTED]> wrote:
> How can i retreive resultset from stored procedures
> from JSP , iam using
> JDBC.
>
> thanks a million.
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Flat files JDBC driver

2000-06-27 Thread Ron Chan

Hi,

Pratik Patel & Karl Moss book "Java Database
Programming with JDBC", 2nd Ed.

has a SimpleText JDBC driver that manipulates text
files. Maybe this is what you want, have not tried it
myself.

ron



--- Jean de Lavarene <[EMAIL PROTECTED]> wrote:
> Hello everybody,
>
> I am looking for a flat files JDBC driver for my
> web application. Right now I am using an ODBC-JDBC
> bridge but I have been told that it was a lot too
> slow and that I should use a direct connection.
>
> Please give me your thoughts,
>
> Jean
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



No Subject

2000-06-27 Thread Ron Chan

Hi,

please say what errors you get.

In any case, you have to result.next() before
accessing the fields.

ron


--- Sanjay Gomes <[EMAIL PROTECTED]> wrote:
> Hello All,
> I have written a simple JSP for connecting to a
> database and displaying a
> particular field in it.
> Can someone tell me whats wrong.
> I know that connecting through a bean is the most
> feasible but am trying out
> this simple JSP first
>
> 
> 
> <%@ page import="java.sql.*" %>
>
> <%! String dbURL="jdbc:odbc:bday";
> String dbCon="sun.jdbc.odbc.JdbcOdbcDriver";
> Connection con=null;
>  ResultSet result;
> %>
> <%
> try{
> Class.forName(this.dbCon);
> con=DriverManager.getConnection(dbURL);
>
> Statement stmt=con.createStatement();
> result= stmt.executeQuery("Select * from bday ");
> }catch(Exception ex)
> {}
> %>
> <%=
> result.getString("Ename")
> %>
> <%con.close();
>%>
> 
> 
>
>
> TIA
> Sanjay
>
>

> Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Invoking a servlet via a hyperlink

2000-06-07 Thread Ron Chan

Hi,

not sure if this is standard approach:

1. make a hyperlink ..
2. give it an onclick="clicked()"
3. define the clicked() function.
4. in the function do a: document.formName.submit()

oh yes, define that form with the method=POST and the
action pointing to your servlet.

ron


--- Ferghil O'Rourke <[EMAIL PROTECTED]> wrote:
> [sorry, not sure this got submitted earlier...]
>
> Anyone got any ideas on how handle hyperlinks in an
> MVC controller servlet?
>
> We've been in the process of developing a servlet
> based on the MVC model 2
> architecture for the last few months now. And many
> thanks to Craig for his
> key contributions here. I've implemented his action
> class mechanism
> successfully to have a single "controller" servlet
> interact with java
> business objects thru action objects.
>
> Each action object maps to the name attached to a
> FORM SUBMIT in our JSP
> pages. So, for example, a pushbutton submits the
> name "RetrieveVendors.do"
> to the controller servlet, the servlet uses this
> string as a key to a
> hashtable of action class names, instantiates the
> relevant action class, and
> finally invokes it's perform() method. The action
> class then takes over and
> performs processing relavant to that pushbutton. It
> also has the facility to
> pull all the data from the SUBMIT into the relevant
> business object.
>
> It all works very nicely. However, the whole
> mechanism does depend on all
> interaction with the controller servlet being
> performed using FORM SUBMITS.
> I'm fine with this but there are times when I'll
> want to interact with the
> controller servlet via a hyperlink - or **via a
> SUBMIT that looks and
> behaves like a hyperlink.**
>
> SUBMITs will always look like button clicks - the
> mouse pointer doesn't turn
> into a finger but remains as an arrow etc. There are
> ways to make SUBMITs
> resemble hyperlinks using IE4 style tags but these
> don't work for netscape.
>
> Anyone encountered this sort of problem before? I'd
> prefer to keep
> everything as a SUBMIT so that I'm always routing
> through the servlet. I'd
> like to compromise and use a real hyperlink only
> when the target page
> contains static content.
>
> Any ideas thoughts really welcome.
> Thanks,
> Ferghil O'Rourke
> USMoving.com - chief programmer
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: StackOverflowError

2000-06-02 Thread Ron Chan

Hi,

also reconsider using recursion for this purpose. All
recursions can be implemented in loops and not incur
the stack problem.

ron

--- Eddie Sheffield <[EMAIL PROTECTED]> wrote:
> Well, it doesn't necessarily mean that you're in an
> infinite loop. As
> another poster pointed out though it does mean
> you're running out of stack
> space. Without going into the gory details every
> time you call a function a
> bit of information is put on the stack, and when the
> function returns the
> info is pulled back off. Recursion can be a bit
> touchy and it is very easy
> to get into an infinite loop (or more precisely
> infinite recursion). And
> since every iteration is a new function call, more
> info is pushed onto the
> stack every call. Eventually all the space is used
> up.
>
> But more to your problem, I would take a serious
> look at the design. Not so
> much of the code that generates the strings as how
> much is being generated.
> Do you really want to present a user with a combobox
> of 600 or more entries?
> That doesn't sound very user-friendly. I've come
> across some pretty long
> ones at times, and they are aggravating to navigate.
> Perhaps you should look
> into reorganizing your pages in some way so that you
> won't have to generate
> such a long list.
>
> HTH!
>
> Eddie
>
> - Original Message -
> From: Liza J Alenchery <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 02, 2000 7:12 AM
> Subject: StackOverflowError
>
>
> > Hello people
> >
> > I am using recusrion to fill up a combobox with
> strings in my JSP
> > program. It works fine when the number of strings
> is less, but throws
> > a StackOverflowError when the number of strings is
> 600 or more. I
> > found in the documentation that StackOverflowError
> means that "an
> > application recurses too deeply."  Does that mean
> I am going into a
> > infinite loop? If not, what can be done in the
> situation? Is a
> > re-design the only way out?
> >
> > Thanks in advance
> > liza
> >
> >
> > __
> > Do You Yahoo!?
> > Yahoo! Photos -- now, 100 FREE prints!
> > http://photos.yahoo.com
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found
> at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: JDk1.2.2 with Oracle

2000-06-02 Thread Ron Chan

Hi,

there is something called the README file that comes
with your Oracle, please make the effort to read it:


Oracle JDBC Drivers release 8.1.6 README



What Is New In This Release?


The major new features added since the initial
distribution of 8i
(8.1.5) are listed in the following:

  - Support for JDBC 2.0 Core API including:
* Scrollable result set.
* Batch updates.
* Large objects and structured types.  (Support
for these data
  types are also available in 8.1.5).

  - Support for JDBC 2.0 Optional Package (used to be
called JDBC 2.0
Standard Extension API) including:
* Connection pooling.
* Distributed transaction.

  - Oracle JDBC connection caching.

  - Other new improvements:
* Vendor code for errors.
* Improved performance on JDBC Server-side
Internal Driver.

  - Basic zip files for debugging.

  - Support for JDK 1.2.x.  (In 8.1.6 SDK, only the
JDBC Thin Driver
supports JDK 1.2.x.  If you have JDBC programs
that were written
for previous releases of Oracle's drivers and you
would like to
run them with JDK 1.2.x, you may have to port your
programs.
Please see the "Support For JDK 1.2.x" section
below for details.)

  - Support for NLS in the Server-side Internal
Driver.  (Note ##)

  - Support for the Server-side Thin Driver for
middle-tier
applications.  (Note ##)

  - Discontinued support for JDK 1.0.2.  (Note ##)

  ## Note:  Also available in 8.1.6 SDK.


Driver Versions
---

These are the driver versions in the 8.1.6 release:

  - JDBC OCI Driver 8.1.6
Client-side JDBC for use on a machine where OCI
8.1.6 is installed.

  - JDBC Thin Driver 8.1.6
100% Java client-side JDBC for use in applets and
applications.

  - JDBC Thin Server-side Driver 8.1.6
JDBC for use by Java Stored Procedures or by Java
CORBA objects
running in Oracle 8.1.6.  This driver is typically
used in a middle
tier server.

  - JDBC Server-side Internal Driver 8.1.6
Server-side JDBC for use by Java Stored procedures
or by Java CORBA
objects running in Oracle 8.1.6.  This driver used
to be called the
"JDBC Kprb Driver".

For complete documentation, please refer to "JDBC
Developer's Guide
and Reference".


Contents Of This Release


The [ORACLE_HOME]/jdbc/lib directory contains:

  - classes111.zip
Classes for use with JDK 1.1.x.  It contains the
JDBC driver
classes except classes necessary for NLS support
in Object and
Collection types.

  - nls_charset11.zip
NLS classes for use with JDK 1.1.x.  It contains
classes necessary
for NLS support in Object and Collection types.

  - classes111_g.zip
Same as classes111.zip, except that classes were
compiled with
"javac -g".

  - classes12.zip
Classes for use with JDK 1.2.x.  It contains the
JDBC driver
classes except classes necessary for NLS support
in Object and
Collection types.

  - nls_charset12.zip
NLS classes for use with JDK 1.2.x.  It contains
classes necessary
for NLS support in Object and Collection types.

  - classes12_g.zip
Same as classes12.zip, except that classes were
compiled with
"javac -g".

  Note that the packaging of the JDBC classes to
support NLS was
  changed in 8i.  The classes pertaining to specific
character sets
  support in Object and Collection types have been
separated from the
  basic zip files.  These NLS classes are now packaged
into the
  extension zip files.  This allows the user to
include the NLS
  classes only if necessary.  Please refer to the "NLS
Extension Zip
  Files (for client-side only)" for further details.

[ORACLE_HOME]/lib directory contains libocijdbc8.so
and
libocijdbc8_g.so (on Solaris), which are the shared
libraries used by
the JDBC OCI driver.

[ORACLE_HOME]/jdbc/doc/javadoc.tar contains the JDBC
Javadoc.  This
release contains a beta release of the Javadoc files
for the public
API of the public classes of Oracle JDBC.

[ORACLE_HOME]/jdbc/demo/demo.tar contains sample JDBC
programs.
Demo programs written for JDK 1.1 must be modified to
run in JDK 1.2.
Please refer to the "Support For JDK 1.2" for porting
details.


NLS Extension Zip Files (for client-side only)
--

The JDBC Server-side Internal Driver provides complete
NLS support.
It does not require any NLS extension zip files,
nls_charset*.zip.
Discussions in this section do not apply to the JDBC
Server-side
Internal Driver.  You can skip this section if you
only use the
Server-side Internal Driver.

The basic zip files, classes111.zip and classes12.zip,
contain all the
necessary classes to provide complete NLS support for:

  - Oracle Character sets for
CHAR/VARCHAR/LONGVARCHAR/CLOB type data
that is not retrieved or inserted as a data member
of an Oracle 8
Object or Collection type.

  - NLS support for CHAR/VARCHAR data members of
Objects and
Collections for a f

Re: Tool for testing and debugging Javabeans?

2000-05-28 Thread Ron Chan

Hi All,

the JUnit test framework by Gamma and Beck to build
test suites is very useful.

ron



--- "D. J. Hagberg" <[EMAIL PROTECTED]> wrote:
> Graham Cruickshanks wrote:
> > Problem, It's a pain debuging runtime errors in
> these javabeans, by running
> > them in jsp pages and getting output,
> >
> > Is there a easy way to debug and run javabeans
> before i use them in the jsp
> > pages?
>
> You might consider using one of the Java-based
> scripting languages such
> as JPython (http://www.jpython.org/) or Jacl
> (http://www.scriptics.com/java/ or the latest
> version at
>
http://www-users.cs.umn.edu/~dejong/tcl/tcljava/prerelease.html).
>
> One nice feature of these scripting languages is
> that you can start up a
> command-line interpreter and
> instantiate/modify/examine objects
> on-the-fly.  Most of my experience is with Jacl, so
> I'll use it for
> these examples.
>
> jaclsh
> % package require java
> 1.2.6
> % set bean [java::new com.blah.MyBean]
> MyBean@0F00
> % $bean getName
> Bubba
> % $bean setName Vern
> Vern
>
> and so forth.  The real interesting part is when you
> notice that you
> have both a full-fledged scripting language (not
> just a command-line
> interpreted Java) and you have the full power of
> reflection --
>
> % foreach method [java::info methods $bean] {
> if {[llength $method] > 1} continue
> if {[string match get* $method] || [string match
> is* $method]} {
> puts "$method=[$bean $method]"
> }
> }
>
> The above loops through all the methods in your
> bean, printing out the
> value of all your getXXX and isXXX accessors.
>
> The next step beyond the above is to build a set of
> test procedures and
> regression tests for your beans.  If you download
> the Jacl source, you
> will see that it comes with its own set of
> regression tests based on the
> very compact tcltest framework.  You basically build
> little code
> snippets like:
>
> test testName-N.M "Description of test" {
> bunch of code to set up objects and call methods
> } {expected output of last statement in above code}
>
> With this, you can start building up a set of test
> cases for both
> positive (non-error) and cases where you expect
> errors to occur.  Every
> time you find a bug in your code, you add a test
> case that reproduces
> the bug -- BEFORE you even fix the bug.  Then after
> you fix the bug,
> re-run the test suite to ensure you didn't break
> something else.
>
> Hope this helps,
>
> -=- D. J.
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Creating a Shopping Cart using Model 2

2000-04-27 Thread Ron Chan

Hi,

for fun, there is an example at:

www.pitt.edu/~urcml

thanks,

ron


--- Marc Krisjanous
<[EMAIL PROTECTED]> wrote:
> Hi all,
> Kevin Duffey has provided me with some helpful
> advice in the way I have
> coded my JSP's.  He mentioned the MVC pattern.  Is
> this something to do with
> the Model 2 architecture that I have seen on this
> group?
>
> If so can someone give me a brief example (in
> English or code) on how I
> could use the Model 2 architecture for a Shopping
> Cart concept.  Note - that
> I have to use JSP ver 0.91.
>
> Also, can someone please send me a URL for a
> beginners guide to Model 2.
>
> Best Regards
>
> Marc
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

__
Do You Yahoo!?
Talk to your friends online and get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: ResultSet first() does not work

2000-04-17 Thread Ron Chan

Hi,

good explanation in pages 589 of White's book "jdbc
api tutorial and reference, 2nd edition".

basically, you need to:

Connection con = Driver...
Statement stmt = con.createStatement(
   ResultSet.TYPE_SCROLL_SENSITIVE,
   ResultSet.CONCUR_UPDATABLE);
stmt.setFetchSize...
ResultSet rs = stmt.execute...

ron

--- "Kowaleski, Michael"
<[EMAIL PROTECTED]> wrote:
> i am trying to access the ResultSet first() method,
> using the default jdbc
> driver shipped with java 2 sdk v1.3 (JdbcOdbc.dll
> version 2.1) and the sun
> javaWebServer 2.0.  i keep getting the following
> error:
>
> java.sql.SQLException: Result set type is
> TYPE_FORWARD_ONLY
>
> this is an example of what i need to accomplish:
>
> ResultSet xSet = y.executeQuery("");
> while (i) {
> 
> if ( xSet.first( ) ) {
> do {
> if ( 0 == name.compareTo(
> xSet.getString( "name" ) )
> )
> color =
> xSet.getString( "color" );
> } while ( xSet.next( ) );
> }
> 
> }
>
> can somebody provide me with an explaination of why
> this does not work?
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

__
Do You Yahoo!?
Send online invitations with Yahoo! Invites.
http://invites.yahoo.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: JSP and JDBC

2000-04-06 Thread Ron Chan

Hi,

page 545, JDBC API tutorial and reference by White et
al., use PreparedStatement with addBatch() and
executeBatch().

ron



--- Portal Team <[EMAIL PROTECTED]> wrote:
> Hi
>
> I have around 100 records worth of data which i
> collect from the client and
> i need to update the database.
>
> Eg. of one record :
> DateOfInput TimeOfInput InputPerson CompanyCode
> DateOfChange NewValue
>
> I have all the data in input boxes and their names
> are sequential eg
> fDate1 fDate2 ..fDate100 fTime1 fTime2..
> fTime100
>
> what i am doing is
>
> First i loop through once and take care of all
> validations on the client
> side.
>
> i am giving an example for 2 fields
> 
> <%
>for (i=1 ; i<100; i++)
>{
> Df=fDate + i;
> tf=fTime  +i;
>
> dDate=request.getParameter(df);
> dTime=request.getParameter(tf);
>
> 
>
>}
> %>
>
> This means i would have 100 insert statemets being
> executed.
>
> I am not sure this is the best way.. and am new to
> JSP and JDBC. I would
> appreciate your suggestions / comments.
>
> This data updation is happening over the internet
> and the database is
> Oracle8i.
>
> thanks in advance
> Vineet
>
>
__
> Get Your Private, Free Email at
> http://www.hotmail.com
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

__
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



example JSP, servlet, JB, JDBC

2000-02-07 Thread Ron Chan

Hi all,

www.pitt.edu/~urcml

there is a simple example covering various java
technologies.

ron
__
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html



Re: Jsp Book

2000-02-04 Thread Ron Chan

Hi all,

also see Wrox's Java and XML, that has some JSP
coverage.

ron


--- Danny Trieu <[EMAIL PROTECTED]> wrote:
> Java Server Progamming is the book to buy.  Right
> now there isn't any book that's
> specific about JSP.  The earliest one that I know of
> is coming out in April or May
> named 'Begining JSP by Darby.
>
> Naresh Singh Chhonker wrote:
>
> > Hello all
> >   I am Beginer in JSP, But Experience on
> servlet,
> >  So Which Books on JSP are avilable in Market
> that are relevant to me?
> >  I am Indian and living in Delhi.
> > Thanx
> > naresh
> >
> >
>
===
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> > FAQs on JSP can be found at:
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>
__
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html