dcsimg
connection pooling not run on Database.executeStatement
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Xiaofeng_Shi
Posted On:   Tuesday, March 19, 2002 11:28 PM

hi,all I use JBuilder6 + mm.mysql , and use JdbcConnectionPool to get connect . When I use Database.executeStatement , Exception occured. Here is my sample code and exception: JdbcConnectionFactory jdbcConnectionFactory = new JdbcConnectionFactory(); JdbcConnectionPool pool = new JdbcConnectionPool(); jdbcConnectionFactory.setUrl("jdbc:mysql://"+strDBServer + ":" + strPort + "/" +strDBName+"?user="+strLoginName+"&password="+strPasswd) ; jdbcConnectionFactory.setDriver("org.gjt.mm.mysql.Driver") ; jdbcConnectionFactory.setUser(strLoginName ) ;    More>>

hi,all
I use JBuilder6 + mm.mysql , and use JdbcConnectionPool to get connect .


When I use Database.executeStatement , Exception occured. Here is my sample
code and exception:



JdbcConnectionFactory jdbcConnectionFactory = new
JdbcConnectionFactory();


JdbcConnectionPool pool = new JdbcConnectionPool();



jdbcConnectionFactory.setUrl("jdbc:mysql://"+strDBServer +
":" + strPort + "/"
+strDBName+"?user="+strLoginName+"&password="+strPasswd) ;


jdbcConnectionFactory.setDriver("org.gjt.mm.mysql.Driver") ;


jdbcConnectionFactory.setUser(strLoginName ) ;


jdbcConnectionFactory.setPassword(strPasswd) ;



try {


pool.setConnectionFactory(jdbcConnectionFactory) ;


}catch ( Exception ex ) {


ex.printStackTrace() ;


}



Database db = new Database();


db.setJdbcConnect(pool.getConnect());


db.executementStatement("delete from table");



Exception occurred during event dispatching:


java.lang.NullPointerException


at com.borland.javax.sql.DelegateStatement.getUpdateCount(Unknown Source)


at com.borland.dx.sql.dataset.Database.executeStatement(Unknown Source)


...



Anybody held me?



Thanks

   <<Less
About | Sitemap | Contact