Hi Karthik,

U have to get the connection object in the code like follows.

Driver myDriver = (Driver)
Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection conn =
myDriver.connect("jdbc:weblogic:pool:sfdmPool ", props);

Rishabh.
                -----Original Message-----
                From:   Narayan, Karthik [mailto:[EMAIL PROTECTED]]
                Sent:   Thursday, April 19, 2001 2:51 AM
                To:     [EMAIL PROTECTED]
                Subject:        Re: single quotes and other special
characters

                Hi,

                Thanks for the information.
                I guess the code goes within the "Submit to Save"
functionality on the JSP
                page.

                I use Weblogic 5.1 .
                If you have used it, there is a section in
weblogic.properties called:

                weblogic.jdbc.connectionPool.sfdmPool=\
                        url=jdbc:oracle:thin:@localhost:1537:service,\
                        driver=oracle.jdbc.driver.OracleDriver,\
                        initialCapacity=1,\
                        maxCapacity=30,\
                       props=user=username;password=password,\
                         allow=guest

                What would the DB connection object be equal to in this
case.

                Thanks

                Karthik


                -----Original Message-----
                From: Nishit Trivedi [mailto:[EMAIL PROTECTED]]
                Sent: Wednesday, April 18, 2001 12:41 PM
                To: [EMAIL PROTECTED]
                Subject: Re: single quotes and other special characters


                use PreparedStatement

                here is the example:
                let's ay your DB connection object is 'dbConn'

                then:
                String fName="myFName";
                String lName="myLName";

                String query = "INSERT INTO <tableName> (FName,LName) values
(?,?)";
                PreparedStatement prStmt = dbConn.prepareStatement(query);
                prStmt.setString(1,fName);
                prStmt.setString(2,lName);
                prStmt.executeUpdate();
                -----------------
                PreparedStatement will take care of all single quotes in
varibles..
                you don't have to bother...

                Nishit

                -----Original Message-----
                From: Narayan, Karthik [mailto:[EMAIL PROTECTED]]
                Sent: Wednesday, April 18, 2001 12:07 PM
                To: [EMAIL PROTECTED]
                Subject: single quotes and other special characters


                > Hi,
                >
                > Is there a way to include single quotes and other special
characters in an
                > input field in a jsp file,
                > which then gets saved into the database.
                >
                > Right now, I get the extra single quote which fails to
submit the entries
                > to the database.
                >
                > Thanks
                >
                > Karthik


===========================================================================
                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


===========================================================================
                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


===========================================================================
                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

===========================================================================
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

Reply via email to