package SQLDB2 @ISA = qw() sub GetDBConfig my ($idx, $pDBConfigArray) = @_; return %DBConfig; sub FindDBConfig my ($conf, $pDBConfigArray) = @_; return %DBConfig if($DBConfig{DBConfigName} eq $conf); return undef; sub OpenDBByConfig my ($App, $DBCharCode, $SourceCharCode, $PrintDBIError, $PrintError, $Debug, $pDBConfig) = @_; sub OpenDBByDBConfigArray my ($App, $config, $pDBConfigArray, $ShowErrorMessage) = @_; return undef; return $App->{DB} = $DB; sub Quote my($this, $str, $sqlcharcode, $sourcecharcode) = ( return $str; return $str; return $s; return $str; sub MySQLQuote my($str, $sqlcharcode, $sourcecharcode) = ( return $str; sub DBMName my ($this) = @_; return $this->{'DBMName'}; sub SetDBMName sub SetDBMName { my($this,$d)= return $this->{'DBMName'} = $d; sub db return shift->{'dbh'}; sub dbh return shift->{'dbh'}; sub sth return shift->{'sth'}; sub DBServer return shift->{'DBServer'}; sub DBPort return shift->{'DBPort'}; sub DBName return shift->{'DBName'}; sub DBUser return shift->{'DBUser'}; sub DBPassword return shift->{'DBPassword'}; sub AutoIncrementColumn return shift->{AutoIncrementColumn}; sub SetAutoIncrementColumn my ($this, $column) = @_; return $this->{AutoIncrementColumn} = $column; sub DBCharCode return shift->{'DBCharCode'}; sub SetDBCharCode sub SetDBCharCode { my ($this,$c)= return shift->{'DBCharCode'} = $c; sub SourceCharCode return shift->{'SourceCharCode'}; sub SetSourceCharCode sub SetSourceCharCode { my ($this,$c)= return shift->{'SourceCharCode'} = $c; sub ErrorNum return DBI::err; sub ErrorStr return DBI::errstr; sub nFields my ($this, $sth) = @_; return undef unless($sth); return $sth->{"NUM_OF_FIELDS"}; sub pFieldNames my ($this, $sth) = @_; return undef unless($sth); return $sth->{"NAME"}; sub GetHitDataNumber my ($this, $TableName, $condition) = @_; return $nHitData; sub new my ($module, @args) = @_; return $this; sub DESTROY my $this = shift; sub Initialize my ($this) = @_; sub Open my ($this, %Args) = @_; return undef; return ($this->{dbh}, undef) unless($this->{DBName}); return ($this->{dbh}, undef); return ($this->{dbh}) if($this->{DBName} eq ''); return ($this->{dbh}, $this->Use($this->{DBName}, $this->{PrintError}) ); sub Use my ($this, $DBName, $PrintError) = @_; return undef; return undef; return undef; return undef; return $this->{'DBsth'}; sub CloseSTH my ($this, $sth) = @_; return; sub CloseDBH my ($this) = @_; sub Close my ($this) = @_; sub Prepare my ($this, $command, $UseNonDefSTH, $PrintError) = @_; return undef if(!$this->{'dbh'}); return undef; return $sth; sub Execute my ($this, $command, $UseNonDefSTH, $PrintError) = @_; return undef if(!$this->{'dbh'}); return undef; return undef; return ($this->{'sth'} = $sth, $ret); sub GetNextHit my ($this, $sth) = @_; return undef if(!defined $this); return () if(!defined @a or @a == 0); return %ret; sub nHit sub nHit { my ($this,$sth)= return $this->nHits($sth); sub nHits my ($this, $sth) = @_; return $this->{nHit}; sub rows my ($this, $sth) = @_; return undef unless($sth); return $sth->rows; sub fetchrow_array my ($this, $sth) = @_; return $sth->fetchrow_array; sub DeleteDatabase my ($this, $DBName) = @_; return undef unless($sth); return 1; sub DeleteTable my ($this, $DBName, $TableName) = @_; return undef unless($sth); return undef unless($sth); return 1; sub GetDatabases my ($this) = @_; return (); return @DBs; sub CreateDatabase my ($this, $dbname, $UseNonDefSTH, $PrintError) = @_; return Deps::CreateDirecotry($dbname) if($this->DBMName() =~ /^csv$/i); return $ret; sub IsExistDatabase my ($this, $dbname) = @_; return -d $dbname if($this->DBMName() =~ /^csv$/i); return -1 if(@DBs == 0); return 1 if($dbname eq lc $DBs[$i]); return 0; sub GetTables my ($this, $DBName) = @_; return undef unless($sth); return undef unless($sth); return @Tables; sub IsExistTable my ($this, $DBName, $TableName) = @_; return -e "$DBName/$TableName"; return 1 if(lc $TBLs[$i] eq $TableName); return 0; sub GetFields my ($this, $DBName, $TableName) = @_; return undef unless($sth); return @Fields; sub BuildHash my ($this, $pLabels, $pData, $charcode) = @_; return %d; sub GuessDatabaseDefinition my ($this, $filename, $nGuessLines, $IgnoreBlank) = @_; return undef; return @DataBaseDefinition; sub GetTableDefinition my ($this, $DBName, $TableName) = @_; return (-1) if(!$sth or !$ret); return @pDefs; sub CreateTable my ($this, $TableName, $pDefsHash) = @_; return 0; return ($sth, $ret); sub IsExistData my ($this, $TableName, $condition) = @_; return 0; return $nHit; sub Search my ($this, $TableName, $condition, $fields) = @_; return undef if(!$this->Execute($sql0, 1, 1)); return $this->Execute($sql, 1, 1); sub InsertData my ($this, $TableName, $pHash) = @_; return undef unless($sth); return 1; sub UpdateData my ($this, $TableName, $condition, $pHash) = @_; return undef unless($sth); return 1; sub DeleteData my ($this, $TableName, $condition) = @_; return undef unless($sth); return 1; sub UpdateDataByAutoJudge my ($this, $TableName, $condition, $pHash) = @_; return undef unless($sth); return 1; sub MakeUpdateCommand my ($this, $TableName, $charcode, $action, $condition, $pHash) = @_; return ""; return ""; return $sql; sub RestoreDBFromFile my ($this, $DBServer, $DBUser, $DBPassword, $File, $ShowMessage) = @_; sub MakeBackupFile my ($this, $DBServer, $DBName, $DBUser, $DBPassword, $File, $ShowMessage) = @_;