Want to create dynamic table with spring and ibatis

I want to create the dynamic table in DAO layer. I need create the table insert the some records and drop the table all these has to happen in DA layer. Please let me know any one has info
atmohsinAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

UmeshSenior Principal Technical Support EngineerCommented:
In MySQL dynamically tables can be created in this way..
set @table_name := 'mytable';
set @sql_text:=concat('create table ',@table_name,'(id int unsigned)');
PREPARE stmt1 FROM @sql_text;
EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
 
 
# Your insert stuff can go here
 
# Later drop the table

Open in new window

0
atmohsinAuthor Commented:
Thanks

I am using the spring+ibatis and mysql server there is DAO layer which interact with DB.

Suppose for updating the result into db we are using following codegetSqlMapClientTemplate().update("updateTestRunSyncStatus", listTestRunIds);

I am not able to get for creating table
suppose i have
String sql="create test (id int,name varchar2(10));
now i need to execute this query.

0
UmeshSenior Principal Technical Support EngineerCommented:


Syntax should be
create table test (id int,name varchar(10)

This may help you...

http://www.jroller.com/dancruz/entry/spring_dao_integration

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.