awips2/nativeLib/ohd.ihfsdb/scripts/run_ihfs_cdbgen
root 9bb8decbcf Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: 133dc97f67 [formerly a02aeb236c] [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 9f19e3f712 [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 377dcd10b9 [formerly 3360eb6c5f]
Former-commit-id: 8e80217e59
2012-01-06 08:55:05 -06:00

45 lines
1.4 KiB
Bash

#!/bin/ksh
if [ $LOGNAME != dsa ]
then
print "\nSkipping generation of IHFS DB C code...\n"
exit 0
else
export JAVA_BIN_DIR=/usr/local/java//bin
export DRIVERPATH=/usr/lib/postgresql-8.2-506.jdbc3.jar
export JAVA_VM_DIR=/fs/hseb/${DS_BUILD}/ohd/java/ohd-common/projects
export IHFSDB_DIR=$JAVA_VM_DIR/ihfsdb
export DB_DIR=$JAVA_VM_DIR/db
export BASEPATH=$DB_DIR/classes
export CLASSPATH=./:$BASEPATH/:$DRIVERPATH
echo "CLASSPATH =" $CLASSPATH
#The connection string
connecturl="jdbc:postgresql://genessee:5432/hd_${DS_BUILD}empty?user=pguser"
#The location of the PreferredTableNames.txt file.
namingfile=$IHFSDB_DIR/scripts/PreferredTableNames.txt
#The destination of the generated source files
targetdir=/fs/hseb/${DS_BUILD}/ohd/whfs_lib/src/IHFSDbGenerated/TEXT
#db name
dbname=hd_${DS_BUILD}empty
#package name -- NONE means no packaging
# Note: this does NOT affect directly in which the generated class is placed
package=ohd.hseb.ihfsdb.generated
db_driver_class_name=org.postgresql.Driver
rm -f /fs/hseb/${DS_BUILD}/ohd/whfs_lib/src/IHFSDbGenerated/TEXT/*.pgc
rm -f /fs/hseb/${DS_BUILD}/ohd/whfs_lib/src/IHFSDbGenerated/TEXT/*.h
$JAVA_BIN_DIR/java ohd.hseb.dbgen.CDbGen $connecturl $namingfile $dbname $targetdir $db_driver_class_name
mv $targetdir/*.h /fs/hseb/${DS_BUILD}/ohd/whfs_lib/inc/dbms/
#cd -
return $?
fi