File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes BMP Datasource connection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "BMP Datasource connection problem" Watch "BMP Datasource connection problem" New topic
Author

BMP Datasource connection problem

henry takoe
Greenhorn

Joined: Apr 29, 2003
Posts: 1
Hi,
I've an entity bean that connects to the database via DataSource object.
I've created a datasource and set the password and id @ the container level.
However when i attempt to connect to the database, i get a user/password not correct SQL error.
What seems to be the cause of the problem? Will the datasource object grab the pwd/id from the container?
Below is a snippet of the connection code. Thks.
public RecordLockebKey ejbCreate(String a_strBwrId, String a_strDeptCode, String a_strUserId, String a_strFunctionID)
throws javax.ejb.CreateException, java.rmi.RemoteException {
Connection l_cnConnection = null;

int l_nSQLStatus = 0;
try {
l_cnConnection = PAMPCommon.getConn(); // Getting connection from pool
l_stStmt = l_cnConnection.createStatement(); // Creating Statement

**The code fragment for PAMPCommon.getConn()**
public static Connection getConn() throws SQLException, ClassNotFoundException {
Connection l_cncon = null;
boolean retry = false;
int numOfRetries = 0;
PAMPCommon l_udForSOP = null;
if(COPAMSConstants.PAMP_DEBUG) l_udForSOP = new PAMPCommon();
do {
try {
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
Context m_cxctxInitial = getInitialContext();
DataSource l_dsdataSource = (DataSource) m_cxctxInitial.lookup("jdbc/pamp");
l_cncon = l_dsdataSource.getConnection();
} .............
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BMP Datasource connection problem