I'm amazed and flattered by this. I think. Or maybe I'm insulted. I'm not
sure.
>From: drew w <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
> reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: invalid object AwardPerson
>Date: Thu, 10 May 2001 19:55:31 -0000
>
>import java.sql.*;
>
>/**
>* DataBaseInsert.java
>* Written by Morgan Catlin Email: [EMAIL PROTECTED]
>* August 19, 1999
>*
>* Variables:
>* String something = something to insert into the database
>*
>* Methods:
>* String getSomething() = returns something
>* void setSomething() = sets something
>* String connect() = connects to database returns success or failure
>message
>* String insertSomething() = inserts something to the database
>**/
>
>public class DataBaseInsert {
>
> String something;
>
> public DataBaseInsert() {
> something = null;
> } // constructor DataBaseInsert
>
> /**
> * Accessor for something
> */
> public String getSomething() {
> return something;
> }
>
> /**
> * Mutator for something
> */
> public void setSomething(String asomething) {
> something = asomething;
> }
>
> public String connect() {
> try {
> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
> return "Driver Loaded!";
> } catch (Exception E) {
> return "Unable to load driver.";
> }
> }
>
> public String insertSomething() {
> try {
> Connection C = DriverManager.getConnection("jdbc:odbc:MyDB", "",
>"");
>
> Statement Stmt = C.createStatement();
>
> String insert = "INSERT INTO AwardPerson (BrandDesc) VALUES ('" +
>this.getSomething() + "')";
>
> int stmtInt = Stmt.executeUpdate(insert);
>
> Stmt.close();
> C.close();
> return "Inserted row " + stmtInt;
>
> } catch (SQLException E) {
> return "SQLException: " + E.getMessage();
> } catch (Exception E) {
> return "Error " + E.toString();
> }
> }
>} // class DataBaseInsert
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.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
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.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