on 12-01-2005 7:34 AM
Hi
I am using from main() method to access jdbc.
Lookup is successful but I got the following error after that
My Code Snippet
Properties jndiCtxProp = new java.util.Properties();
jndiCtxProp.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl" );
jndiCtxProp.put(Context.PROVIDER_URL, "host:port");
jndiCtxProp.put(Context.SECURITY_PRINCIPAL, "login");
jndiCtxProp.put(Context.SECURITY_CREDENTIALS, "password");
Context initCtx = new InitialContext(jndiCtxProp);
DataSource dataSource =
(DataSource) initCtx.lookup("jdbc/FLIGHTDATA");
System.out.println("nFLIGHTDATA lookup successn"); //no problem upto this
conn = dataSource.getConnection();
I have used the following JAR's
logging.jar
sapj2eeclient.jar
exception.jar
jdbc20.jar
jta.jar
connector.jar
opensql.jar
opensqlapi.jar
opensqlcore.jar
sqljapi.jar
tc_sec_secstorefs.jar
Exception chain is
com.sap.engine.services.dbpool.exceptions.BaseSQLException: ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.dbpool.exceptions.BaseResourceException: SQLException thrown by the physical connection: com.sap.sql.log.OpenSQLException: Could not instantiate class com.sap.sql.connect.OpenSQLDataSourceImpl.
at com.sap.engine.services.dbpool.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:59)
at com.ibm.training.carrier.dbload.JDBCLoader.getConnect(JDBCLoader.java:63)
at com.ibm.training.carrier.dbload.JDBCLoader.doLoad(JDBCLoader.java:29)
Thanks
Ananda
Hi ananda,
Check on to this link for references to ur exceptions:
http://help.sap.com/saphelp_erp2005/helpdata/en/b5/0cb8359ae4ad4387b38d866801690f/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/f3/790555c806491fa772ad46543255ed/frameset.htm
Hope this helps u,
Regards,
Nagarajan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi anand,
Is it not throwing u any error after u give catch statement also?
<b>try()
{
coding for DB
}
catch(Exception e)
{
wdComponentAPI.getMessageManager.raiseException("Exception :" +e);
}</b>
Even this din work?
http://help.sap.com/saphelp_erp2005/helpdata/en/de/7d77f8714b4ef080f2219d7d968008/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/70/a19cc472e72c4481172909938578fc/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/91/ccbf560ecc4e2fb99b09a5e7bce95e/frameset.htm
Hope this helps u,
Regards,
Nagarajan.
Hi,
as on any j2ee server, the proper way to obtain datasources and connections is to look them up via jndi interfaces, as described in the NW documentation:
http://help.sap.com/saphelp_erp2005/helpdata/en/b5/0cb8359ae4ad4387b38d866801690f/frameset.htm
Why do you instantiate the data source in a remote client?
Do you simply run tests? Anyway, this does not really make sense. Use server side components for this, for example servlet/jsp pages for tests.
good luck, Katharina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi !
The first thing you might want to do is check where the DataSource is bound to JNDI. There are views to the JNDI-tree NOT accessible from the outside (in terms of a seperate process).
AFAIK you have a global namespace accessible from the outside, a java:/ namespace accessible only from the app-server itself and a java:comp/env namespace accessible only from the component deployed.
If bound to java:/ namespace you have to lookup from something within a deployment (write a simple Servlet if u just want to test it)
Regards
Matthias
OpenSQL in stand-alone mode is not supported but can only be run in the 6.40 (and higher) SAP WebAS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ananda,
You should check in your server log file to see if it has anything interesting to say about this failure. What authentication method are u using /crypt/password/...)? The driver shouldn't be bailing out with
an error like that, but it is unclear where the actual problem is. so it would be helpful if you downloaded the lastest version of the driver.
http://jdbc.postgresql.org/download.html#jars
Regards,
Nagarajan.
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 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.