Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

ramdas nayak

Greenhorn
+ Follow
since Jul 13, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ramdas nayak

can some body tell the procedure for Weblogic version 5.1
20 years ago
this servlet has been tested for retreiving Blob datatype for image file form DB2 Database.Kindly convert it for oracle database wherevere needed thanx.
package test;
/**
* Insert the type's description here.
* Creation date: (1/23/99 11:36:37 PM)
* @author: Administrator
*/
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class BlobServlet extends javax.servlet.http.HttpServlet
{
Connection con= null;
Statement stmt= null;
ResultSetrs= null;
/**
* Process incoming HTTP GET requests
*
* @param request Object that encapsulates the request to the servlet
* @param response Object that encapsulates the response from the servlet
*/
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
{
performTask(request, response);
}
/**
* Process incoming HTTP POST requests
*
* @param request Object that encapsulates the request to the servlet
* @param response Object that encapsulates the response from the servlet
*/
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {
performTask(request, response);
}
/**
* Returns the servlet info string.
*/
public String getServletInfo() {
return super.getServletInfo();
}
/**
* Initializes the servlet.
*/
public void init() {
// insert code to initialize the servlet here
}
/**
* Process incoming requests for information
*
* @param request Object that encapsulates the request to the servlet
* @param response Object that encapsulates the response from the servlet
*/
public void performTask(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
{
try
{
// I have tested this servlet for my application change to make it general

//change here to remove hard coding of the sql query
String rSQL="select * from BlobTest where row_id='12'";
//change database driver and url etc.

Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
con=DriverManager.getConnection("jdbc:db2:SAMPLE","db2admin","udbadmin");
stmt=con.createStatement();
rs=stmt.executeQuery(rSQL);
//if no O/p found then just display message on the browser

if(! rs.next())
{
response.setContentType("text/html");
PrintWriter pout= new PrintWriter(response.getOutputStream());
pout.println("No Matching records found ");
pout.flush();
pout.close();

}//if(! rs.next())
// for reading the message set this .
response.setContentType("image/gif");
ServletOutputStream out= response.getOutputStream();
InputStream in=rs.getBinaryStream(2);
ByteArrayOutputStream baos= new ByteArrayOutputStream();
byte b[]= new byte[1024];
while(true)
{
int bytes=in.read(b);

if(bytes == -1)
{
break;
}//if
baos.write(b,0,bytes);
}//while
b=baos.toByteArray();
response.setContentLength(b.length);
out.write(b,0,b.length);
out.flush();
out.close();
System.out.println("successful");

}//try
catch(Throwable theException)
{
response.setContentType("text/html");
PrintWriter pout= new PrintWriter(response.getOutputStream());
pout.println("Exception while retreiving");
pout.flush();
pout.close();

}
finally
{
try
{

if(stmt != null) stmt.close();
if(rs != null) rs.close();
if(con != null) con.close();

}//try
catch(Exception ex)
{

}//catch
}//finally
}
}
20 years ago
It is advisable that u use VAJ enterprise edition if ur using
IBM Websphere application server.The reason being that
Testing environment for u'r whole application on the VAJ it self before deployment on the actual server can be of great help.
20 years ago

thank you Marcos Maia with your suggestion i was able fix the problem
thankx once again..
bye.
20 years ago
can any body please suggest me the detail procedure for creating new Application Server in weblogic server (not a default myserver) in weblogic.

thanx in advance.
20 years ago

Originally posted by Amit Vaidya:
I'm trying to deploy a CMP bean which uses a DB pool. Satabase is DB2 on OS/390. I'm using 'COM.ibm.db2.jdbc.app.DB2Driver' JDBC driver. When I start the Weblogic server (after copying the bean jar file into application directory), it gives me following error:
--------------
weblogic.ejb20.cmp.rdbms.RDBMSException: Unexpected failure while accessing table 'ejbAccounts': java.sql.SQLException: Connection Pool demoPool does not exist. java.sql.SQLException: Connection Pool demoPool does not exist. at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:148)at weblogic.jdbc.common.internal.ConnectionPool.reserveWaitSecs (ConnectionPool.java:113)



Following is the property that u need to add to weblogic.properties file, for creating
connection pool for DB2 database.

Make sure of the following:

> machine on which the weblogic server will be there must have latest DB2 client (7.1)
> you should be using jdbc 2 drivers for DB2. for confirming this, go to java folder & open db2java.zip file.
It should have DataSource.class file. If it doesn't, go to java12 folder & check usejdbc2.bat file is present.
Run this file & ur drivers will be modified to use jdbc2 drivers.
> add db2java.zip file to weblogic server's classpath.

Change items in red according to ur settings.
---------------
weblogic.jdbc.connectionPool.DB2Pool=\
url=jdbc:db2:logistic,\
driver=COM.ibm.db2.jdbc.app.DB2Driver,\
loginDelaySecs=1,\
initialCapacity=1,\
maxCapacity=5,\
capacityIncrement=1,\
allowShrinking=true,\
shrinkPeriodMins=5,\
refreshMinutes=5,\
testTable=,\
props=user=xxxx;password=xxxx;server=xxxx
set appropriate values for'xxxx'
hope it will be of some help to u...
ramdas
20 years ago
I am trying to use Weblogic with IBM Db2.It's giving Exception as "Class Not Found for DB2 driver COM.ibm.db2.jdbc.app.DB2Driver".can anybody please suggest in which folder should i place db2java.zip (COM.ibm.db2.jdbc.app.DB2Driver)
thanx.
20 years ago
I am trying to run WAS3.5 Resource Analyser for monitoring
performance of resources deployed on WAS server remotely.
I gave command as c:\websphere\ra\bin\ra <host machine name> 900
from DOS .The RA tries to open console and gives error as
"There is no performance service bean on the server" .
It also throws exception on the DOS console as
C:\WebSphere\ra\bin>ra <host machine name>
Bad command or file name
Syntax error
Syntax error
Exception: java.rmi.ServerException: RemoteException occurred in server threa
nested exception is:
com.ibm.ejs.container.UncheckedException: ; nested exception is:
com.ibm.websphere.csi.CSIException: Failed to start transaction
anticipating solution for this
thank's in advance
20 years ago