Jotty Tharakan

Greenhorn
+ Follow
since Dec 14, 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 Jotty Tharakan

We are taking conection from IAS connection pool for our work.My doubt is this.
If Bean A takes a connection from pool and set the attribute of the connectio object to
con.setAutocommit(false).After commit he is returning the conection to pool.
Now suppose Bean B gets the same connection from the pool and he is expecting the default attribute from the connection object.So he is not committing explicitly.
I suspect that since bean A sets the attribute to Autocommit(false) the updation done by bean B will not be committed unless bean B explicitly commit it.
Can anyone comment on this .Is my conclusion correct or not ?
Can any one suggest performancewise which is the best driver for n-tire architecture and tell the reason also.AlsoCan anyone suggest some sites regarding these issues ?
Since while rs.next() lop is over the resultset is pointing to the end.that's why it is not giving any record.
To use the result set again for retrieving the values
use rs.beforeFirst()
and then u can use while rs.next() again to retrieve the values.
Rgds
George
I have a doubt implementing setting the fetch size.I set the fetch size for statement and result set as follows.
statement.setFetchSize(300);
rs.setFetchSize(300);
but if i'm changing(increase or decrease) fetchsize of statement as well as rs , the time required for processing increase ,and i found that this combination gaves the better result.Number of records fetched is 304.
Why it is behaving like this ? can any one help me ?
is there any connection between number of rows expected and fetch size.If it is then suggest me how to find suitable combination.
We are using connection pool from an application server.
Also if i'm using a cachedrowset how can i set the fetchsize if i'm using rowset.exceuteonnection con);
Rgds
George
In my jsp page i am using one java bean in session scope.user can select any number of records randomly across the page and can finally submit for cancellation of all the selected records(Across the page).After submitting i will show the success page.
here my problem is when to remove that object from session.
If i am removing object from session on launch of success page then if user clicks on browser back it will show the previous page and if he is trying to submit again or clicking on page links page will throw error(null poinet error).
can any one suggest solution for this
George
18 years ago
JSP
Dear all,
I want to know about J2ME ?.Whether this is also platform independent.What are the advantages of J2Me.What are the softwares required for this.
I'm very new to mobile tech.can anyone explain briefly.
Rgds
George
18 years ago
Hi friends
I'm a SCJP and a regular visitor of this site.
I want to take up the SCWCD exam.Can any one give me the details regarding this ,also can any one suggest books,mok exam sites etc.What is the basic requirments
Rgds
Jotty tharakan
Jamie ,
I'm agreeing with u but is it necessary to close all objects like resultset and statement objects or closing the connection itself will close all related objects ?
Can u pls clear this point
18 years ago
Hi sandhya,
I am supproting david's suggestion for the design.Offcourse application server tuning is a must for good performance.But still it will ease ur job in real time scenario.
U said u have to pull more than 9000 records at a time.I think u can use cachedrowset provided by sun.It is easily managable upto 60,000 records using this object and it is serializable object.It act as a temporary table.
Jennifer ,
I'm from india .I don't know much about overseas
market.But i can suggest a few things.
It's better u learn something more than core java.SCJP will give u an advantage only u are qualified in other areas also.
Probably u can choose JSP and XML.Offcourse JDBC is a must for all java developers.
gvtharakan@rediffmail.com
GeorgeTharakan
SCJP
18 years ago
If you close the connection whether all related DBObjects like Resultset,statement objects are also closed or we need to close each and every one of them explicitly.
18 years ago
Following is the sample of our code
public class CA_ActivityUpdate_esb implements SessionBean
{
SessionContext sc;
Connection con;
DBConnection db;
public void ejbCreate() { }
public void ejbActivate(){}
public void ejbPassivate(){}
public void ejbRemove() {}
public void setSessionContext(SessionContext s)
{
sc = s;


}
public void insertData()
{
try
{
// seperate bean to obtain connection
//from app server using initial context
db = new DBConnection();
con = db.connect();
// calling sp using the connection con
// main sp is calling other sp's inserting data into more than one table
if (errorcode !=0)
{
sc.setRollBackOnly();
throw new EJBException("errorcode");
}
}
catch(Exception e);
{
throw new EJBException("errorcode");
}
}

}

we are calling the setSessionContext method in our EJBProgram
as follows
SessionContext sc;
public void setSessionContext(SessionContext s)
{
sc = s;


}
and using this context(sc) we are doing rollback
sc.setRollBackOnly();

is it correct to call this method ? Otherwise how to roll back without a session context.
If possible can u send an example stateless session bean programe involving DB transaction.
Also i want to know difference between InitialContext and sessionContext.

kyle one more doubt
if connection is created in one context(initial context) am using another context(session context)context we are doing roll back .will it create any problem ?.
we are using setSessionContext method to get the context
whether it carries the transaction context also .
what is the diff between session context and initial context ?



we are using seperate bean to lookup the connection
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/mapsDB");
java.sql.Connection con = ds.getConnection();
and in EJB we are calling this bean to get the connection
we are creating seperate context in ejb and using that context
we are managing transaction .
in case of rollback we are using ejbcontext.setRollbackOnly().
This method fails when u are modifying more than one table.
For single table updation it is working perfectly.
is it because connection object is in different context