manipulating JDBC Datasources from a java application or servlet

How can i manipulate - add, delete, update - JDBC Datasources from a java applcation or servlet?
[124 byte] By [msohaib] at [2007-9-26 1:23:11]
# 1
You should ask more specific.On this general level one can only recommend this to you: http://java.sun.com/docs/books/tutorial/jdbc/index.html
Hartmut at 2007-6-29 1:01:18 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

Generally, such operations are implemented in product vendor specific ways and outside of application code.

For example, in Allaire JRun, you can use the management console, or in weblogic you can specify a JDBC data source in some properties file etc.

I know the above may sound stupid in light of your question specifically targeting application code. However, I think a good question to ask in return is Do you really have a need to do it from application code

neville_sequeira at 2007-6-29 1:01:18 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
>Do you really have a need to do it from application codeI really DO NEED to do it from application code. The purpose of my application is to "generate" other web-applications.
msohaib at 2007-6-29 1:01:18 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

Maybe we can help, if you explain a little more.

What do you mean with:

> How can i manipulate - add, delete, update - JDBC

> Datasources from a java applcation or servlet?

Do you want to

* create databases

* change a database's properties

* create or change tables

* create or change the rows in tables

Each of these would be - more or less - possible, but on its own way.

Or do you maybe want to configure ODBC Datasources (DSNs) for use with the JDBC-ODBC-Bridge?

Thats all I can guess from what you told us. Tell more!

Hartmut at 2007-6-29 1:01:18 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

What do you mean with:

> How can i manipulate ...

I mean that I want to add, delete, update "JDBC Datasources" defined in an Application Server from my application. Normally JDBC datasources are found under java:comp/env/jdbc namespace in JNDI and are defined at deployment time either using a deployment descriptor or through Application Server's configuration tool.

I want the ability to manipulate these JDBC datasources from my application.

regards,

msohaib at 2007-6-29 1:01:18 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...