Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connection pooling not run on Database.executeStatement

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
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 help me?

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top