This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Connection Pooling Problem  RSS feed

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear sir,
I have a problem about using a connection pool in a servlet.Server giving error(Can't open socket on MyPool:1433.check host and port number and make sure security manager allows this connection.You can also try running Socket Applet(java.net .unknownhostException: MyPool).In Driver classname:-weblogic.jdbc.mssqlserver4.Driver.In key=value section(user=sa
password=none because in sqlserver there is no password).And in "target" section I chosen myserver.Please guide me how I can slove this problem.I tried but could not find the way."MyPool" is my connection pool name.
Following r my codes:-
It is my servlet file:-
------------------------
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.sql.*;
public class Pool 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=(Driver)
Class.forName("weblogic.jdbc.mssqlserver4.Driver").newInstance();
}
catch(Exception e)
{
System.out.println("Error from Driver:" + e.getMessage());
}
try
{
con=DriverManager.getConnection("jdbc:weblogic:mssqlserver4:MyPool",null);

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


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

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

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

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

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

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

}
}


It is my html file:-
-----------------------<html>
<head>An example</head>
<title>Test</title>
<body>
<form method="post" action="http://127.0.0.1:7001/Start5">
Enter Your Name
<input type="text" name="Name" size="25">

Enter Your Password
<input type="password" name="Password" size="25">

Enter Your Address
<input type="text" name="Address" size="25">

Enter Your ContactNo.
<input type="text" name="ContactNo" size="25">

<input type="Submit" value="Submit">
<input type="Reset" value="Reset">
</form>
</body>
</html>
With regards
Bikash

------------------
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I forgot to write iam trying to connect weblogic6.0 to sqlserver7.0 through connection pooling.Iam trying to enter data from html from through servlet.
Thanks for ur valuable Time
Bikash
------------------
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this question is already in this forum HERE and I already fixed the formatting of that version, I'm going to close this thread.
Dave.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!