Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!

Sujith Kanaparthi

Ranch Hand
+ Follow
since Sep 04, 2005
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 Sujith Kanaparthi

The query SELECT TNAME, ROWNUM FROM TAB WHERE TABTYPE = 'TABLE' can be used to get the table name and the row number of that tablename.

Hope this may help you.
Even if you execute the procedure from Oracle you get only the last record values fetched into the out parameters before closing the cursor.I mean if you put "dbms_output.put_line(id||' '||name||' '||add||' '||year);" statement after "end loop;" and before "close Cursor_SearchByName;" statement you will know that.

If you would like to iterate through the cursor from the java code, then you need to have the cursor as out parameter.

Hope this may help you.
I'm from Hyderabad, India

15 years ago
I have worked with tomcat a little bit...the URL mapping is wrong


Intead of <url-pattern>/servlet/email5/EmailServlet</url-pattern>
use <url-pattern>/EmailServlet</url-pattern>

Hope this may help you
15 years ago
The public long lastModified() of java.io.File can used for sorting based on date and time of last modification of file

Regards,
sujith
15 years ago
Happy Friendship Day to all ....
15 years ago
A few points as checklist:
1) Have you set the ojdbc14.jar to classpath environment variable
2) Have you Registered the driver in the code before getting connection object (say by using Class.forName())

Regards,
Sujith
As clarified by Satou kurinosuke, session and request are different things.

When forward is used we can pass data to the forwarded page using request.setAttribute() as the same request and response objects available the forwarded servlet/jsp.But in in case of sendRedirect() we have to set the data in session or by appending the data to the URL that will be passed as argument to this method, because by calling this method a new request is created.
16 years ago
response.sendRedirect() sends a response to the browser asking it to load another page, whereas in the case of RequestDipsatcher.forward() control is transferred to another servlet or jsp within the server.
Using sendRedirect() on one server, we call redirect a call to a resource on located on different server which is not possible using forward().
Hope this may help you.

Regards,
Sujith
16 years ago
Verify whether the following are set :

1. ORACLE_HOME environment variable set
2. ORACLE_HOME\bin added to System path
3. ORACLE_HOME\lib added to System path
4. NLS_LANG or nls_sort is set
5. LD_LIBRARY_PATH is set to ORACLE_HOME\lib and ORACLE_HOME\jdk\lib

Regards,
Sujith
[ May 03, 2006: Message edited by: Sujith Kanaparthi ]
I'm not sure how you are trying to create the datasource.But you can use org.apache.commons.dbcp and org.apache.commons.pool package classes to create the DataSource in Tomcat(5.5.12) and I myself used them for DataSource creation.Hope you too can implement the same and try it out
-----
Class.forName(jdbcDriverClassName);
connectionPool = new GenericObjectPool(null);
connectionFactory = new DriverManagerConnectionFactory(jdbcConnectionURL,UserID,Password);
poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);
dataSource = new PoolingDataSource(connectionPool);
--------

Regards,
Sujith
Hi Alana,
If you are using Container Managed Transactions(CMT) and set the container transaction type to 'Required' then call setRollBackOnly()(javax.ejb.EJBContext contains this method) in the block where you want to rollback the transaction whenever an unexpected situation raises.Hope this may help you.

Regards,
Sujith
Hi Nalini,

I'm not very clear about your query but You can use java object in java script.
you can assign like this:
var str = '<%=someString%>';
or else if you want to manipulte some java object inside java script you can place that in scriplets(like <%......some java statements.....%> .Hope this may solve your problem.

Reagrds,
Sujith
16 years ago
JSP
Hi Kannan,

the try catch block works perfectly if i use a IF condition


You are getting Nullpointer Exception here, because you are trying to invoke the method (equalsIgnorecase()) on a null object.Whenever you try to manipulate a object which is null then Null pointer exception is thrown

if(abc.equalsIgnorecase("null"))


If you want to compare whether the String object returned by Diffclass.getString() method is null or not then you must code it like this:
if(abc==null)

else the try catch block is never reached


When you comment if condition in your code, then you are not manipulating the returned String object, so an exception is not thrown when that returned string object is null.

Regards,
Sujith
16 years ago
Hi Sean,

Try to call your procedure like this,
callableStatement = conn.prepareCall("{call SCHEMA_NAME.PACKAGE_NAME.PROCEDURE_NAME(?,?)}");
I hope this may solve your problem.
I'm not sure about these privileges but cross-check whether the user with which your able to get connection object is granted the permission to execute the procedure.

Regards,
Sujith