cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create new tables in SAP<SID>DB schema at Runtime

Former Member
0 Kudos

Hi:

Can anyone tell me how can I create new tables at Runtime in Web AS 6.40 J2EE Engine?

Thkns

Armando

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Employee
Employee
0 Kudos

Hi Armando,

Well, it depends on the type of your application, but generally you can get connection to the DB through the J2EE Engine default DataSource:

DataSource ds = (DataSource) initialContext.lookup("jdbc/SAP<SID>DB");
Connection conn = ds.getConnection();

and execute statement "CREATE TABLE TMP_BLA ...":

Statement st = conn.createStatement();
st.executeUpdate("CREATE TABLE TMP_BLA ...");

Hope that helps!

Vladimir

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vladimir,

It cannot works because the connection is Open SQL and the statement Create, alter or drop is not supported.

but thanks for the advise.

Im trying to get the connection different that datasource

thnks

Armando

Vlado
Employee
Employee
0 Kudos

OK Armando,

Then create another datasource with SQLEngine type "VendorSQL" to the <SID> DB instance using again the SAP<SID>DB schema user and use this datasource to get connection to the database.

Hope this helps,

Vladimir