cancel
Showing results for 
Search instead for 
Did you mean: 

How can i change the creation of tables from the default database

Former Member
0 Kudos

Dear Sirs,

I have created a data base in MaxDB. I have also created the new datasource for my application.

Now, when i create Entity bean and for that the dictionary; new tables are creating in the default database. I want to create the tables in new database not in the default database.

I have created the datasource.

The data-source-aliases.xml file shows the data source as "<data-source-name>${com.sap.datasource.default}</data-source-name>".

My datasource name is DataSourceTesting. Is it because of this?, if yes; then how can i select my datasource?

How can i change the creation of the table from dictionary to the newly created database?

Kindly help

Sudheesh.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

This question has been lingering around for some time now, i.e. redirecting the Java Dictionary tables to be created in custom databases rather than default Server database.

when i look into the Webdynpro project in Java Perspective inside the gen_wdp folder, i can find the standard xml's like application xml,etc. Now can we add the data-source.xml as we do in our J2EE projects so that the Dictionary tables are created in the custom database. This is an idea which am yet to try.

Regards,

S.Divakar

katarzyna_fecht
Explorer
0 Kudos

Hi,

no, no way. Save your time. Dictionary framework will not use datasources that you can define inside a (Web Dynpro) application.

- You can indeed create server side datasources, for example in the xml file you found in the project. But they are intended to be used by database access components (jdbc, sqlj, jdo, ejb cmp).

Dictionary framework will not use it. And it always works with the system database.

regards, Katharina

katarzyna_fecht
Explorer
0 Kudos

Hi,

i suppose you create tables using Java Dictionary. Java Dictionary creates tables in the system database (schema) of the server only. So if you would like to use another db ( or another db schema on the same db instance) you have to create tables manually.

(It doesn't matter which datasource you are using - at runtime. Dictionary dies not operates on it.)

Regards, Katharina

Former Member
0 Kudos

Hi Sudheesh,

Try giving ur datasource in this manner:

InitialContext ctx=new InitialContext();

DataSource ds=(DataSource)ctx.lookup(jdbc/DataSourceTesting);

Connection con=ds.getConnection();

This should work for u,

Regards,

Nagarajan.