Skip to Content
author's profile photo Former Member
Former Member

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

Hi:

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

Thkns

Armando

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on May 07, 2005 at 01:29 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 08, 2005 at 02:11 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.