Hi, I'm developing a Java Based Web Application, in this application, I have several pages that insert and read information from a DB2 database located in a AS400 Server (730, I think), my problem is that when several pages are opened to access the same table, some of them throw an SQL Exception just with the explanation: "Could not register driver" and do not show any information. I am not using Resultsets, just executing SQL sentences over a Statement object, is there a problem with several querys at the same time?, I'ts my first time with Java & AS400 DB2, and I'm really confused about it, this is part of the code: DriverManager.setLoginTimeout(600); Connection cn = DriverManager.getConnection(url, usr, pwd); String query ="SELECT ... "; Statement st = cn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_UPDATABLE); st.setFetchSize(25); rs = st.executeQuery(query); I don't know what's happening, when I access several pages one after another it works Ok, but when all of them try to read (not update) the same information at the same time, some of them throw error. is it possible that the AS400 server is denying connection to the database because of the number of open connections?. Each page has it's own Instance of st,cn,rs, etc. Thnx.
P.S. Sorry if I'm not specific enough, my english is not very good, if you did understand anything about what I just wrote, please write to email@example.com , thanks a lot.
Are you using the Java SDK (NET)? If you are then you are getting the same connection on each request. Also, you are opening a connection each time, which introduced a performance penalty. As you are using a web application, try using pooled datasources instead of the DriverManager. We currently use Websphere 5 and use JNDI to look up the datasources and then get a connection from that. Once you have finished with a connection, remember to close it.
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad: