Hi all friends,

I have a problem with my connection pooling using in
servlet.Iam using weblogic6.0 server I create one
connetionpool name "Dear" in console of weblogic
server(url=jdbc:weblogic:pool:biku(biku is my DSN
name)Driver class=weblogic.jdbc.pool.Driver In
key=value section user="sa" password="" server="kdk"
In "Target" section i choose "myserver")and iam using
Driver package(weblogic.jdbc.pool.driver).when i going
to enter some data into sqlserver7.0 through servlet
using connection pool .Weblogic server giving
error(Error from get
connection:java.sql.sqlexception:pool connect
failed:weblogic.common.resourceexception:none
available).Any help will be highly apreciated.

Following r my codes:-

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.sql.*;
public class connection extends HttpServlet
                {
                        String queery,queery1=null;
  public void doPost(HttpServletRequest
req,HttpServletResponse res)
                   throws ServletException,IOException

                                {
                                  Connection con=null;
                                 ResultSet rs=null;
                                 Statement stmt=null;
                                  PrintWriter out = res.getWriter();
                                  res.setContentType("text/html");
                                  String str1=req.getParameter("Name");
                                  String str2=req.getParameter("Password");
                                  String str3=req.getParameter("Address");
                                  String str4=req.getParameter("ContactNo");
                                  out.println(str1);
                                  out.println(str2);
                                  out.println(str3);
                                  out.println(str4);

       try
           {
                Driver myDriver=(java.sql.Driver)

Class.forName("weblogic.jdbc.pool.Driver").newInstance();

           }
        catch(Exception e)
           {
                System.out.println("Error from Diver:" +
e.toString());
           }
        try
           {


con=DriverManager.getConnection("jdbc:weblogic:pool:Dear",null);


           }
        catch(Exception e)
           {
                System.out.println("Error from getConnection:" +
e.toString());
           }


           try
                {
                 stmt=con.createStatement();
                }
           catch(Exception e)
                {
                  System.out.println("Error from Statement:" +
e.toString());
                }
           try
                {
                  queery="INSERT INTO TABLE3 (Name,Password) VALUES
('"+str1+"',"+str2+")";

                }
           catch(Exception e)
                {
                  System.out.println("Error from sqlStatement:" +
e.toString());
                }
           try
                {
                  stmt.executeUpdate(queery);

                }
           catch(Exception e)
                {
                  System.out.println("Error from Excecution:" +
e.toString());
                }

         try
                {
                  queery1="INSERT INTO TABLE4 (Address,ContactNo)
VALUES ('"+str3+"',"+str4+")";

                }
           catch(Exception e)
                {
                  System.out.println("Error from sqlStatement:" +
e.toString());
                }
           try
                {
                  stmt.executeUpdate(queery1);

                }
           catch(Exception e)
                {
                  System.out.println("Error from Excecution:" +
e.toString());
                }
                 try
                {
                  con.close();

                }
           catch(Exception e)
                {
                  System.out.println("Error from colsing:" +
e.toString());
                }
           }
        }

Thanks in Advance
Bikash


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

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to