Connection Pooling Porgram in JBuilder 6 Ent does not working.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Arloogoo_Lee
Posted On:   Wednesday, February 27, 2002 12:35 PM

Hi, Maybe someone can help me on the following problems. Thanks. I have been trying copy and using the JBuilder 6 Enterprise sample program at "sample/JDataStore/WebBench" code with JdbcConnectionFactory and JdbcConnectionPool to develop a connection pooling java program with MS SQL Server. The program compiled with no error inside JBuilder 6, but got the error message after I'd executed it. import com.borland.dx.dataset.*; import com.borland.dx.sql.dataset.*; import com.borland.javax.sql.*; import java.sql.*; class Test { public static void main (String args[] ) throws Exception { try { JdbcCo   More>>

Hi, Maybe someone can help me on the following problems. Thanks.
I have been trying copy and using the JBuilder 6 Enterprise sample
program
at "sample/JDataStore/WebBench" code with JdbcConnectionFactory and
JdbcConnectionPool to develop a connection pooling java program with MS
SQL
Server. The program compiled with no error inside JBuilder 6, but got
the
error message after I'd executed it.



			
import com.borland.dx.dataset.*;
import com.borland.dx.sql.dataset.*;
import com.borland.javax.sql.*;
import java.sql.*;

class Test {
public static void main (String args[] ) throws Exception {
try {
JdbcConnectionFactory factory = new
JdbcConnectionFactory();
factory.setDriver("sun.jdbc.odbc.JdbcOdbcDriver");
factory.setUrl("jdbc:odbc:SQL_DB");
factory.setUser("scott");
factory.setPassword("");
JdbcConnectionPool pc = new JdbcConnectionPool();
pc.setConnectionFactory(factory);

/*
this code does not work here
Database database1 = new Database();
database1.setDataSource(pc);
there is no method setDataSource in Database
*/
Connection conn = pc.getConnection();
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select ename from
emp");
while (rset.next())
System.out.println(rset.getString(1));
}
catach (Exception e){}
}
}

I got these error messages:
Exception in thread "main" java.language.NoClassDefFoundError:
javax/transaction/xa/XAResource
at
com.borland.javax.sql.JdbcConnectionFactory.getXAConnection(Unknown
Source)
at
com.borland.javax.sql.JdbcConnectionFactory.getPooledConnection(Unknown
Source)
at com.borland.javax.sql.JdbcConnectionPool.a (Unknown Source)
at com.borland.javax.sql.JdbcConnectionPool.a (Unknown Source)
at com.borland.javax.sql.JdbcConnectionPool.getConnection(Unknown
Source)

I did make sure compile with J2EE JDBC extenion jar libraries.
Am I mission DataSource here or what?

   <<Less
About | Sitemap | Contact