× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Looking at them real quick, I would try to seperate my business logic from
my presentation. Seperate the connection and all HTML from the servlet. Use
JSP's for the presentation and a bean for the connection to the database. I
am trying to use the WebSphere connection pool for database access. I would
like someone elses opinion on connection pools (actual use).  You might
also try putting your try {  database connection  } catch block inside the
init() method after super.init(config) statement. init() is initilized one
time and you only need database connection one time.

private Statement statement = null;
private Connection conn = null;
private String URL = "jdbc:as400://web400;
private String userid = "";
private String password = "";

public void init( ServletConfig config )
      throws ServletException
{
  super.init( config );
try
    {
      Class.forName("com.ibm.as400.access.AS400JDBCDriver");
      con  = DriverManager.getConnection(URL, userid, password);
 }   catch (Exception e)  {
     e.printStackTrace();
     conn = null;
}


                                                                                
                                            
                    "Stone, Brad V (TC)"                                        
                                            
                    <bvstone@taylorcorp.co        To:     
"'JAVA400-L@midrange.com'" <JAVA400-L@midrange.com>               
                    m>                            cc:                           
                                            
                    Sent by:                      Subject:     RE: Source 
Evaluation?                                       
                    java400-l-owner@UUCPHO                                      
                                            
                    ST.MCS.NET                                                  
                                            
                                                                                
                                            
                                                                                
                                            
                    02/08/01 04:06 PM                                           
                                            
                    Please respond to                                           
                                            
                    JAVA400-L                                                   
                                            
                                                                                
                                            
                                                                                
                                            




Well, the first two want em posted, so here we go.  :)
I'll attach them to this mail.

Thanks everyone!  Be honest and let me know what I'm doing wrong, and maybe
at least one thing I'm doing right.  :)

Here's how it works.  getfilename.html calls getFileName which builds HTML
and another form and calls runSQL.

Brad



> -----Original Message-----
> From: tmalin@hannasteel.com [mailto:tmalin@hannasteel.com]
> Sent: Thursday, February 08, 2001 3:42 PM
> To: JAVA400-L@midrange.com
> Subject: Re: Source Evaluation?
>
>
>
> Brad,
>
>      Post them, so we all can learn. Ill give my two cents
> and maybe learn
> something new in the process.
>
>
> Tom
>
>
>
>
> +---
> | This is the JAVA/400 Mailing List!
> | To submit a new message, send your mail to JAVA400-L@midrange.com.
> | To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to
> JAVA400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner: joe@zappie.net
> +---
>


(See attached file: getfilename.html)
(See attached file: getFileName.java)
(See attached file: runSQL.java)

Filename:
Library:


getFileName.java

runSQL.java


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.