Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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();

}

-


Former Member
Not what you were looking for? View more on this topic or Ask a question