on 08-18-2004 9:14 PM
Hi, I am trying to use mysql datasource for my application. I had configured MYSQL_DRIVER and then
i had configured gtasappdb datasource with
driver-class-name = com.mysql.jdbc.Driver
url = jdbc:mysql://localhost:3306/appdb
alias = appdbdatasource
And then i tried to deploy a EJB application which uses the above 'appdbdatasource'. When the application starts
it says cannot find 'gtasappdb' connectionfactory.
So can anyone tell me what should be done to use mysql for my application, please
Hi Mahesh,
I just want to add a remark to Prasad's reply. Please, use the first suggested option - that is, declare a resource reference and then use the resource reference name to lookup the data source.
See the following documentation for information about resource references: http://help.sap.com/saphelp_nw04/helpdata/en/64/8590109a86f145958fb22dab86d58d/frameset.htm
Zornitsa
P.S. Also, make sure you register the data source with 'Native SQL' support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello mahesh,
There are two ways.
1. You should add a resource reference to the ds alias in the deployment descriptor of the application component.Once you have defined the reference,use the following snippet to access the data source
DataSource ds = (DataSource) context.lookup("java:comp/env/<res-ref-name>").
2. If you have not defined the reference in your application, use the JNDI reference "jdbc/alias".
Hope this helps,
Prasad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.