how to create database in ms-sql server using java/jdbc
siva krishna pallapu
Greenhorn
Joined: Aug 12, 2008
Posts: 7
posted
0
hi,
this is siva and this is my situation.. i need to create a database in ms-sql server using java/jdbc .the database creation script will be in .sql file.
we can create the database with the help of osql commands if the local system is installed with ms-sql server.
but i need to create the database on the remote system without ms-sql server installed in my local system.
I wondered that too. With SQL Server I'd try connecting to the master database (which always exits) as sa. That should work?
siva krishna pallapu
Greenhorn
Joined: Aug 12, 2008
Posts: 7
posted
0
yeah you are right mr.ulf mitter .. but my requirement is to create a database using java or any other api it can be either with .bat files also but the local system should not contain any servers installed in it..
for ex: let us say if the local system contains ms-sql server then we can create the databases on remote systems using osql commands.. but this is not not my situation local system will not have any servers installed on it.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
Can you use Telnet to log into the other machine? If so, you can use the Apache Commons Net library (which contains a Telnet client) to run osql on the server itself. Using SSH instead of Telnet would also be an option.
But in general I would say that the creation of a database should be a sufficiently rare occasion that it doesn't need to be automated to this degree. How often do you foresee running this? [ September 15, 2008: Message edited by: Ulf Dittmer ]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: how to create database in ms-sql server using java/jdbc