i want to use the connection pool by a common java,not use ejb.but it`s display "Could not dereference object".
the code:
Context initContext = new InitialContext();
DataSource ds = (DataSource)initContext.lookup("java:comp/env/MSSQLDS");
connection = ds.getConnection();
pstmt=connection.prepareStatement("select count(bank) from bank");
pstmt.execute();
rs=pstmt.getResultSet();
Help me!
Hi,
Try
DataSource ds = (DataSource)initContext.lookup("java:/MSSQLDS");
Ed.