on 03-14-2007 10:53 AM
Hi all,
I set up the datasource refer to the following homepage:
Java Development Manual - Reference - Tutorials - Persistence
- Getting Started with Relational Persistence
- Assembling the Application
- Managing Aliases
After creating the datasource, I can connect to Database on Visual Administrator.
But I can't refer that detasource on WebDynpro.
That code in WebDynpro is :
-
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/HSQLJ2EDB");
-
And it occured the following error
=================================
com.sap.engine.services.connector.exceptions.BaseResourceException: ConnectionFactory "HSQLJ2EDB" does not exist. Possible reasons: the connector in which ConnectionFactory "HSQLJ2EDB" is defined is not deployed or not started.
=================================
Have you seen that error and know how to resolve ?
Thanks.
Regards.
Hi all,
I resolved this question.
My WebDynpro name was different from datasource name.
I can connect to Database after i change the WebDynpro name is HSQLJ2EDB.
WebDynpro code is:
-
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/HSQLJ2EDB");
-
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I resolved this question.
My WebDynpro name was different from datasource name.
I can connect to Database after i change the WebDynpro name is HSQLJ2EDB.
WebDynpro code is:
-
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/HSQLJ2EDB");
-
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Naga Raju Meesala.
I try the code you teach, but it occures the following error.
-
com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of HSQLJ2EDB.
-
and,i try these code, but they get same errors.
ctx.lookup("jdbc/<data-source-name>");
ctx.lookup("<data-source-name>");
Please tell me how to resolve that error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
try with this code
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/HSQLJ2EDB");
regards,
naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dera Naga Raju Meesala.
I try the code you teach, but it occures the following error.
-
com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/jdbc/HSQLJ2EDB.
-
Please tell me how to resolve that error.
Dear Vito Palasciano.
I verify the datasource alias :
(Info.)
> Driver:
> name = 'HSQL_DRIVER'
> jar = C:\home\opt\hsqldb\lib\hsqldb.jar
>
> DataSource:
> Application Name : local/DCM
> DataSource Name : HSQLJ2EDB
> Aliases : none
> Driver Name: HSQL_DRIVER
> JDBC Version: 1.x (no XA suppoprt)
> JDBC 1.x Compliant
> Driver Class: org.hsqldb.jdbc.Driver
> Database URL: jdbc:hsqldb:hsql://localhost/
> User: SA
> PASSWORD: PASSWORD1
>
> [Additional] Properties:
> url = jdbc:hsqldb:hsql://localhost/
> user = SA
> password = PASSWORD1
>
> [Additional] SQL Engine
> [x] Vendor_SQL
>
> [DB Initialization]
> Execute -> OK
Is it wrong?
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.