on 04-15-2008 1:37 PM
Hello all together,
actually I try to implement an user interface for using BRTools from a J2EE Application.
I created a datasource-alias "BRTOOLS" using netweaver administrator.
inside the implementation i execute the following code:
DataSource ds = (DataSource) ctx.lookup("jdbc/BRTOOLS");
Connection con = ds.getConnection();
String query = "select * from SDBAH;";
Statement stmt = con.createStatement();
try {
ResultSet rs = stmt.executeQuery(query);
........
As the result I get the following message:
The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]: - 1:15 - the table or view >>SDBAH<< does not exist.
Using SQLplus or dbconsole I can see and use the table SDBAH. The table scheme is "SAPSR3DB"which is the standard scheme for J2EE.
If I try:
select * from SAPSR3DB.SDBAH;
I get the same result.
What is wrong in my constellation?
Thank you very much in advance.
Greetings Stephan
Hi,
Which SAP NW version are you using.
If you are using SAP NW 7.1 CE you can try this blog
/people/sampath.gunda8/blog/2008/02/21/connecting-an-application-to-an-external-database-in-sap-nw-ce-71
Regards,
Srinivasan Subbiah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Stephan,
[Managing Aliases|http://help.sap.com/saphelp_nw70/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm] says the following:
If you add an alias for the default DataSource, or for a DataSource that has been deployed with a service or a library, you have to restart the J2EE Engine cluster to enable the changes.
Did you do this after you registered your alias?
Regards,
Yordan
Dear Yordan,
yes I did a restart of the whole system.
If I do a wrong lookup:
e.g:
DataSource ds = (DataSource) ctx.lookup("jdbc/BRToolsFailure");
where Alias "BRToolsFailure" does not exist, I get
Object not found in lookup of BRToolsFailure.
So I think that the Alias of the default data source is right and visible.
Next try:
I use an already existing alias "ADS" in my code and get the same message:
The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]: - 1:15 - the table or view >>SDBAH<< does not exist.
If I extend the tablename with the scheme-name "SAPSR3DB" I get the following:
The SQL statement "SELECT * FROM "SAPSR3DB"."SDBAH"" contains the semantics error[s]: - 1:24 - the table or view >>SDBAH<< does not exist
When I use SQLPLUS SAPSR3DB/password and call:
select * from SDBAH;
I get a result like expected.
Thanks a lot,
Stephan
Hi,
During the creation of datasource have you given your database name in the Database URL correctly.Does it match with the one you have created.
Regards,
Srinivasan Subbiah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivasan,
sorry I dont understand your question.
What I have done is the following:
I started the Netweaver Administrator and navigated the following path:
system management => configuration => application ressources
There I have selected JDBC Data Source Aliases from the dropdown list
press Create.
Ressource Type = JDBC Data Source Alias
Ressource Name = BRTools
System = E15 (SID of SAP DataBase)
JDBC Data Source = SAPSR3DB (SAP Scheme)
Then OK and I thought its enough.
What do you mean with:
database name in the Database URL
The database name is "E15", what is the database URL?
Thanks a lot in advance,
Regards Stephan
Hi,
String query = "select * from SDBAH;";
In the above query remove the semicolon and try like
String query = "select * from SDBAH";
Regards,
Srinivasan Subbiah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivasan,
first of all thank you for your quick reaction.
The statement without semicolon, as you recommended, I already tried before I created this thread.
But I tried it again, but the result was the same.
The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]: - 1:15 - the table or view >>SDBAH<< does not exist
It results from this code snippet:
try {
ResultSet rs = stmt.executeQuery(query);
}
catch (Exception re) {
throw new Exception(re.getLocalizedMessage());
}
Do you have another ideas solving my problem?
Thanks a lot,
Stephan
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
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.