on 04-21-2006 6:59 AM
HI!
J2EE engine default datasoure is connecting to SAP DB,i want to use sybase ,when i create a new datasource ,how can i get the connetion of sybase db,if anyone give the step and java code wirtten in WebDynpro...such as :
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("mySybase");
if (ds==null) {
throw new Exception("DataSource is null");
}
Hi Ree,
have you already data source and an alias for sybase DB on your server defined? When yes i think you sholud loking for data source with:
ctx.lookup("jdbc/<your alias for synase>")
Regards
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just wondering if you managed to get the datasource working?
I just installed a SQL Anywhere database and was able to get the datasource configured/connected and now I'm having trouble with execution of a stored procedure. You said that you got the datasource connected, are you able to monitor the connection from within the Visual Administrator? What kind of SQL Engine did you specify? I had to specify "Vendor SQL" in order for the connection to initialize. When I try to close the connection, it blows up? Is it possible to use straight JDBC code or do you have to use the com.sap.sql.NativeSQLAccess classes?
...Scottd
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,i met the same problem.
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();
}
-
i config JDBC connector in visual administration :
DataSource name: sy_DS;
DataSource aliases:sy_ds;
Dirver name:sybase_driver(a name of i 'd registered a sybase jdbc1 driver );
JDBC version:1.X;
driver class:com.sybase.jdbc.SybDriver;
DataBase URL:jdbc:sybase:Tds:192.168.0.1:4001/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/sy2_ds");
Connection c =ds.getConnection();
<b><u> /*
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.
*/</u></b>
} catch (NamingException e) {
e.printStackTrace();
}
-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
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.