Re: AW: Create DB instance using java
jlegeny <[email protected]>
| Newsgroups | gmane.comp.db.sapdb.general |
|---|---|
| Message-ID | <[email protected]> |
Hello Kolja, I have interested by your java program. Can you help me with my problem to create new db instance using JAVA ? Thank you in advance, Julian Kolja Kleist wrote: >Hello, >I've written a Java program that creates/recover a database. >It's based on an XML-file which specifies the database properties. >If you are interressed in, you can contact me... > >regards, >Kolja > > >-----Ursprüngliche Nachricht----- >Von: [email protected] >[mailto:[email protected]]Im Auftrag von jlegeny >Gesendet: Donnerstag, 7. August 2003 14:31 >An: [email protected] >Betreff: RE: Create DB instance using java > > >Hi, > thank you for your answer. > > I would like to ask you, how can I create new DB instance first and >then set up the parameters. I want to create for example new db instance >"TEST_DB" (it doesn't exist yet) and then set up for example parameter >CAT_CACHE_SUPPLY = 600. > > I have try your java example and used command 'db_create'. (Is it >neccessary to have x_server started, if yes, how can I do it in JAVA?). > > Properties pt = new Properties(); > pt.setProperty("host", "localhost"); > pt.setProperty("dbname", "TEST_DB"); > String dbuser = "DBM"; > String dbpasswd = "DBMPASSWORD"; > String result = null; > > DBM mydbm = new DBM(pt); > // is this command correct for creating new instance??? > result = mydbm.cmd("db_create"); > >but the error was occured: >================================================= >com.sap.dbtech.rte.comm.RTEException: Server or DB unknown >StandardDataSource:getConnection Cannot get connection for URL jdbc:sapd >b://localhost/TST1 : SAP DBTech JDBC: Cannot connect to >jdbc:sapdb://localhost/TEST_DB [Restart required]. >================================================= > > Can you send me please a short example (step by step) how to do it by >JAVA. > > 1. create new db instance "TEST_DB" into <INSTALL_PATH> directory > (dbmcli -R <INSTALL_PATH> db_create <DB_NAME> dbm,dbm) > > 2. set up parameter CAT_CACHE_SUPPLY = 600 > (param_put CAT_CACHE_SUPPLY 300) > > 3. set up DATA volume size to 50 MB > (param_addvolume 1 DATA <DIR_VOLUME>\<DB_NAME>\DISKD0001 F 51200) > > 4. something else what is important for successfull db instance >installation > > > Thank you in advance for your response, > Julian > > > > >Schroeder, Alexander wrote: > > > >>Hello Julian, >> >>You simply need to do something like this >>import com.sap.dbtech.powertoys.DBM; >>... >> >>.. somewhere in code >> >> Properties pt = new Properties(); >> pt.setProperty("host", "localhost"); >> pt.setProperty("dbname", "DB74"); >> String dbuser = "DBM"; >> String dbpasswd = "DBMPASSWORD"; >> String result = null; >> >> DBM mydbm = new DBM(pt); >> result = mydbm.cmd("user_logon " + dbuser +","+dbpasswd); >> result = mydbm.cmd("param_startsession"); >> ... >> >> mydbm.release(); >> >>... >> >>'result' contains the text that would appear on the dbmcli console, >>that is 'OK' on most commands. >>Keep in mind that for Java access the x_server must be started, as it >>uses TCP/IP to >>connect to the database. >> >>Regards >> >>Alexander Schröder >>SAP DB, SAP Labs Berlin >> >> >> >> >>>-----Original Message----- >>>From: jlegeny [mailto:[email protected]] >>>Sent: Thursday, August 07, 2003 11:08 AM >>>To: [email protected] >>>Subject: Create DB instance using java >>> >>> >>>Hi, >>> how can I create new database instance and set database parameters >>>(MAXDATADEVSPACES, MAXUSERTASKS, CAT_CACHE_SUPPLY, number and size of >>>data/log volumes, ...) IN JAVA? >>> Is it possible to do it using java API ? >>> >>> For dbmcli is used 'com.sap.dbtech.powertoys.DBM' package. >>>I need to know, how can I setup database parameters (followed under) >>>in JAVA. >>> >>>param_startsession >>>param_init OLTP >>>param_put CAT_CACHE_SUPPLY 300 >>>param_checkall >>>param_commitsession >>>param_addvolume 1 DATA %DIR_VOLUME%\%DATABASE_NAME%\DISKD0001 F 51200 >>> >>>Thanks for your answer, >>>Julian >>>_______________________________________________ >>>sapdb.general mailing list >>>[email protected] >>>http://listserv.sap.com/mailman/listinfo/sapdb.general >>> >>> >>> >>> >> >> >> >> >> > > >_______________________________________________ >sapdb.general mailing list >[email protected] >http://listserv.sap.com/mailman/listinfo/sapdb.general > >_______________________________________________ >sapdb.general mailing list >[email protected] >http://listserv.sap.com/mailman/listinfo/sapdb.general > > > >