Skip to Content
avatar image
Former Member

SOS: how to obtain a JDBC connection in webdynpro?

i can get an connection of sybase driver with this way(coder in webdynpro implementation):

-


......

try {

DriverManager.registerDriver(new SybDriver());

con =DriverManager.getConnection("jdbc:sybase:Tds:192.168.0.1:4000/dbName","username", "password");

} catch (SQLException e) {

e.printStackTrace();

}

-


but i wanna obtan a connection by jdbc connector.

following i config it in visual administrator:

DataSource name: sy_DS;

DataSource aliases:sy_ds;

Dirver name:sybase_driver(a name of i 'd registered a sybase jdbc1(jconn.jar) driver );

JDBC version:1.X;

driver class:com.sybase.jdbc.SybDriver;

DataBase URL:jdbc:sybase:Tds:192.168.0.1:4000/dbName;

user: username

password:password

===============================

follow coder is in webdynpro implementation to obtain a connecton:

....

try {

Context ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup("jdbc/sy_ds");

Connection c =ds.getConnection();

<i><b>/*

debug by step by step get a exeception here:

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: Porting factory for ADAPTIVE SERVER ENTERPRISE database not defined.

*/</b></i>

} catch (NamingException e) {

e.printStackTrace();

}

-


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 29, 2006 at 09:23 AM

    Hi

    Check your JDBC driver is registered. or else you have register it

    1. Start the Visual Admin tool

    2. In the tab Cluster, open the node of the server you want to check.

    3. Open the node Services under the server you want to check.

    4. Click on the entry ClassLoader Viewer under Services. 5. The components are displayed in the right window. Open the node Applications in the right window.

    6. Look for the entry sap.com/com.sapportals.connectors.database and click on it.

    Under sap.com/com.sapportals.connectors.database, your JDBC driver should be available

    Cheers

    Jawahar Govindaraj

    Add comment
    10|10000 characters needed characters exceeded