Bala Ramachandran

Greenhorn
+ Follow
since Aug 20, 2001
Merit badge: grant badges
For More
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 Bala Ramachandran

Hi,
I have a Cognos based application that needs to invoke a servlet for authentication. The Cognos Access Manager has a C++ method. I need to invoke the authentication servlet from inside this method. Since it is enterprise security mechanism, I don't have much choice about the security authentication. The servlet is a blackbox to the applications.
Is there a way I can invoke this servlet from inside the C++ method either by simulating a HTTP client or socket ?
Thank You
Bala.
22 years ago

Originally posted by amit malhotra:
Hello Manjunath,
thanx a lot for the reply, But as far is EJB is concerned I am totally blank,Is this the way normal search engines like Google do it,please reply back


Hi,
The way I did this is:
When you get the results from the JDBC or any other call, store the results in a vector and a current index variable in the session (the index variable is to indicate the last row that is being displayed). If you are currently going forwar in the resultset, this will be the last row displayed among the 20 rows. If you are going backwards, this will be the first row among the 20 rows.
Give the users choice to get the previous 20 results or the nex 20 results. The URL for forward or reverse should have a flag that indicates to the JSP what to do (reverse or forward).
Based on which link they click, use the vector in the session, current index variable in the session and just decrement or increment from the index variable and show those elements from the vector. Also make sure you update the index variable to indicate the current position of the access.
Hope this helps.
Bala.
22 years ago

Originally posted by Mike B:
Cheers Bala, that works nicely!
out of interest, can I call any of my code classes from a JSP or do they have to be "special" javabeans". Im trying normal instantiation and then calling the method and getting nowhere.
ie
<jsp: useBean id="nO" class="com.NewObject"/>
nO.getMyName();
this throws an error; if I do it with say, a Date class ie
<jsp: useBean id="dT" class="java.util.Date"/>
String thisHour = String.valueOf(dT.getHours());
this works fine
whats the difference between me calling my own class (which implements Serializable) and the Date class??
Thanks for your help and your time
Mike B


Hi,
What kind of error do you get if you use your own class ?
Anyway generally speaking,
You can instantiate any class from your JSP as long as
i) the location of that class is included in the classpath
ii) import the package in which the class resides in your jsp as
<%@ page session="true" import = "ods.*, java.util.*;" %>
There is not much difference between using system defined classes and your own classes as long as the location of those classes are visible to the JVM (i.e., they are in teh classpath) and the JSP imports the right package.
Hope this helps.
Bala.
22 years ago

Originally posted by Mike B:
Hiya, Im new to JSP but quite familiar with servlet development. Im trying to call a bean from my jsp page.
the jsp is on my server root (ie d:\arc_server)
i have set up my servlet directory as follows and
my servlets execute from d:\arc_server\web-inf\classes
if I want my jsp page to use a bean where in iPlanet do I tell it find my bean class. Is there some directory that the JSP engine automatcially looks for the beans??
Thanks for your help
Mike B


Hi,
Just add the directory to your web-server's classpath. Only then the JSP engine will be able to pick up the class.
Whether it be beans or servlet, the directory in which it is stored, needs to be in the web-server's classpath.
Bala.
22 years ago

Originally posted by Rajesh Pydimukkala:
hi,
I am working with I-Planet web server. when ever i am making any changes to my jsp file, i have to delete the version file in ClassCache directory. is there any other way to refresh my page with having to go through the same deletion process.
regards
rajesh


Hi,
I am having the same problem as you do. Have you found any solution for this ? I checked the documentation and could find nothing.
Thanks
Bala.
22 years ago

Originally posted by Nathanael Ulrick:
Since you'll be running a servlet, the net driver would probably be the most appropriate....
db2java.zip should already be on the server, in sqllib/java
I would copy this file to the client. It should work even if the two machines are different types. Include this file in your classpath.
Also, you have to execute db2jstrt on the server. If you do not specify any arguments, this will open port 6789.
Connect with the net driver using a url which should look something like this:
jdbc:db2:yourserver:6789/yourschema


Hi,
Thanks a lot for your help. I confirmed that the server has db2java.zip and then I ran db2jstrt on the server. I was able to get past the problem.
Thanks
Bala.
Hi,
I have an iPlanet web-server running on Sun Solaris box. Everytime a JSP in the server is changed and I attempt to load the new version of the page in the browser, the server stops serving any page that has Java. I am able to load static pages, gifs etc., But the server does not load any JSP, servlet (even totally unrelated ones to the changed page).
I don't get any compile errors. But after I restart the server, it is ok. The new version of the page gets loaded. Sometimes it works after one or two changes, but after the third change, I definitely have to restart the server.
Can anyone help me with this ?
Thanks
Bala.
22 years ago

Originally posted by Fred Guo:
What type jdbc driver is used? if you use net driver, you have to make sure the listener of the DB started, which port it listen to. If you use app driver, you need to install UDB client software on the machine that your program is running.
Fred


Hi,
When I use the 'app' driver, I get the message "No suitable driver found". I have the UDB client installed on the client machine and have the db2java.zip in the classpath.
I downloaded the Sun Solaris version of the UDB client and installed it on the Sun machine.
What does this message mean ?
Thanks
Bala.

Originally posted by Fred Guo:
What type jdbc driver is used? if you use net driver, you have to make sure the listener of the DB started, which port it listen to. If you use app driver, you need to install UDB client software on the machine that your program is running.
Fred


Hi,
I have tried both the 'app' driver as well as the 'net' driver.
When I use the 'app' driver, I get the message "No suitable driver found". I have installed the UDB client on the Sun machine (from where I am trying to run the Java program).
So I switched to the 'net' driver. I will have to check that the db2jstrt is running on the server in the port '6789'. In that case will my conenction URL also have '6789' as the port number instead of '50000' that I used for 'app' driver ?
Thanks
Bala.

Originally posted by Nathanael Ulrick:
To use the net driver, you need to have db2jstrt running on the host machine. The default port then would be 6789, although you can specify a different port. I've read somewhere that you'd need db2jstrt running on the client with the same port as well -- I doubt this is the case, but try it if you get stuck. Also, the copy of db2java.zip has to be the same as the one on the server.
If you use the app driver, the client config assistant needs to know about the server, and the port that you'd use won't be the same as the above (usually 50000, if you've only got one instance of db2.)
By the way, the JDBC drivers on 6 and 7 are buggy, so get the latest fixpack (and don't forget to keep db2java.zip in sync.)
You might find a 3rd party driver, eg from HiT Software much simpler to use.


Hi,
Thanks for the reply. I have the db2java.zip in the Sun machine (which is the client). Does it mean I need the db2java.zip in the database server too ? If so, what version should I use. The database server is a IBM SP2 running on AIX. Will the version of db2java.zip be compatible with the db2java.zip in the Sun machine ?
Also, in the connection URL should I use 50000 or 6789 ?
I appreciate your help.
Thanks
Bala.

Originally posted by Fred Guo:
My project needs to access DB2 using JDBC. It runs on different machine (Unix, Solaris) from DB2 (AIX). After unix administrator installed DB2 client software and modified the global profile (adding db2profile there), I can run a stand-alone program to access DB2. However, if I integrate the program into a web application and run it from browser, it can't load jdbc driver. Since our web server dose not have servlet engine, we need using a cgi batch file to wrap the env. varibles. I set all necessary env. varibles in the batch file. It seems web server can not communicate with DB2, or create a DB2 instance.
Please help me to fix the problem. Thanks.
Fred


Fred,
I am trying to access DB2 UDB in AIX from a sstand-alone Java program in a Sun machine. But I get a SQL exception:
COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0616E Error opening socket. SQLSTATE=08S01.
Can you help me solve this ?
Thanks
Bala.
Hi,
I need some help in figuring out the JDBC access to DB2.
I am trying to acces a DB2 UDB database server from a stand-alone Jaba application, thru JDBC using "COM.ibm.db2.jdbc.net.DB2Driver". I get the following exception:
COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0616E Error opening socket. SQLSTATE=08S01.
When I try it with the driver "CON.ibm.db2.jdbc.app.DB2Driver", I get the exception:
java.sql.SQLException: No suitable driver
I have installed the DB2 client on my machine and I have the db2java.zip included in my classpath.
Actually I need to use this is a JSp/servlet. But I thought I would first test it in a simple Java program.
Can anyone help me ?
Thank You
Bala.