tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "fifi129 " <fifi...@my-Deja.com>
Subject Problem in setLoginTimeout()
Date Wed, 20 Sep 2000 09:22:50 GMT
I've written a login java bean for my system.
After numbers of users login failed, the cpu usage increase and 
cannot evolved.  After restart the Database server, it seems to be better.

I use the script 'DriverManager.setLoginTimeout(2)' to control the 
timeout time, but it does not work after the server is start for a period of time.

The login java beans script is as follows:
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

String connectionString="jdbc:oracle:thin:" + is_userid + "/" + is_password + "@" + dbid;
String queryString="begin :1 := sa.APPLN_PKG.sf_appln_list(:2, :3) ; end;";

Connection conn;

DriverManager.setLoginTimeout(2);

conn=DriverManager.getConnection(connectionString);

CallableStatement cstmt = conn.prepareCall(queryString);
cstmt.registerOutParameter(1,OracleTypes.CURSOR);
cstmt.setString(2,is_userid);
cstmt.registerOutParameter(3,java.sql.Types.INTEGER);
cstmt.execute();

ResultSet rs = (ResultSet)cstmt.getObject(1);

row_cnt = cstmt.getInt(3);
appln_id = new String[row_cnt];
while(rs.next()) 
{  appln_id[rec_cnt] = rs.getString(1);
   rec_cnt++;
}
cstmt.close();
conn.commit();
}
catch(Exception e) 
{         return -1;  }

Best regards,
Fannie
(p.s. I am using apache 1.3.12, Tomcat 3.1 and Linux redhat 6.1, 
the database server is Oracle 8i)


--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.

Mime
View raw message