ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pritesh saharey <prit...@sqatester.com>
Subject RE: how to create database
Date Mon, 31 Mar 2003 12:25:39 GMT
Rajat look what i had done in one of my target
<target name="database" description="Creating database ">
		
				
		<input
    		message="Please enter driver name:"
    		addproperty="db.driver" />
		<input	
			message="Please enter URL :"
			addproperty="db.url"
		/>
		<input	
			message="Please enter Uesr ID :"
			addproperty="db.user"
		/>
		<input	
			message="Please enter Password :"
			addproperty="db.pass"
		/>
	<property file="build.properties"/>
		
		<sql
    		driver="${db.driver}"
    		url="${db.url}"
    		userid="${db.user}" 
    		password="${db.pass}"
			print="yes" output="outputfile.txt"><!-- src="../database/cafcaSan28Mar03.sql"-->
  			
			<fileset dir="../database">
    			<include name="cafca.sql"/>
  			</fileset>

			<classpath>
      			<pathelement location="../seclusion/mm.mysql-2.0.1-bin.jar"/>
    		</classpath>

  		</sql>
	</target>

here where i want to create database ,now i have to create database explicitly by writing
this "CREAT Database ABC"
now what should i do rajat


--- "Rajat Gupta" <Rajat.Gupta@oracle.com> wrote:
>Hi Pritesh,
>What I did in my sample located at
>http://otn.oracle.com/sample_code/tech/xml/survey/content.html was to use
>the 'exec' task as follows :
>
>  <target name="InstallDataBase">
>     <exec executable="sqlplus"  os="Windows NT, Windows 95"
>resultproperty="database.install" failonerror="true"
>failifexecutionfails="true">
>       <arg line="System/${db.system.pwd}@${db.tnsname}
>@${sample.home}\sql\AutoInstall.sql ${db.tnsname}"/>
>     </exec>
>
>     <exec executable="sqlplus"  os="SunOS, Linux, Solaris, HP-UX"
>resultproperty="database.install" failonerror="true"
>failifexecutionfails="true">
>       <arg line="System/${db.system.pwd}@${db.tnsname}
>@${sample.home}/sql/AutoInstall.sql ${db.tnsname}"/>
>     </exec>
>  </target>
>
>Hope this helps,
>Thanks,
>Rajat
>
>-----Original Message-----
>From: Pritesh saharey [mailto:pritesh@sqatester.com]
>Sent: Monday, March 31, 2003 11:32 AM
>To: Apache mailing list
>Subject: how to create database
>
>
>Hi all,
>     I would like to know how can i create a databse using sql task as like
>to create database as well its tables ,iam able to create tables for my data
>base but was unable to create database
>as sql tage allows insert statments but not create statments,like this
><sql
>    driver="org.database.jdbcDriver"
>    url="jdbc:database-url"
>    userid="sa"
>    password="pass"
>    src="data.sql"
>    rdbms="oracle"
>    version="8.1."
>    >
>insert
>into table some_table
>values(1,2,3,4);
>
>truncate table some_other_table;
></sql>
>Now if i want to create database like "Create Database ABC" and then want to
>run my .sql script of create tables how can i do that.
>pls can anybody help me out
>pritesh
>
>
>
>_____________________________________________________________
>Join SQAtester.com Community  --->
>http://www.sqatester.com/testersarea/joinus.htm
>
>_____________________________________________________________
>Select your own custom email address for FREE! Get you@yourchoice.com w/No
>Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org

_____________________________________________________________
Join SQAtester.com Community  ---> http://www.sqatester.com/testersarea/joinus.htm

_____________________________________________________________
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP &
more! http://www.everyone.net/selectmail?campaign=tag

Mime
View raw message