Java.pm

2001-04-11 Thread cbell

Thanks to all that replied, I'll try unziping the JAR file before using
it...




Java.pm

2001-04-11 Thread cbell

Thanks again to all that replied to my earlier posting, however, I've
run into another issue.  I followed the link in one of the replies to
http://www-personal.umich.edu/~mcafee/perl/java-pm.html and discovered
that this module was different than the one I'm attempting to use.

Originally I was trying to use Java.pm Version 3 created by Mark
Trostler which I downloaded from CPAN. Does anyone know which one I
should be using?  I'm trying to execute Java procedures in class files
from within ModPerl.

I'm new to Java and a little confused on how to make this work.

Thanks,
Chris.




Re: Java.pm

2001-04-11 Thread cbell

I did take a look at it originally, but it didn't seem to do what I needed it
to.  I'll take another look...

Robin Berjon wrote:

 At 11:34 11/04/2001 -0400, cbell wrote:
 Originally I was trying to use Java.pm Version 3 created by Mark
 Trostler which I downloaded from CPAN. Does anyone know which one I
 should be using?  I'm trying to execute Java procedures in class files
 from within ModPerl.

 Haven't tried it, but maybe you should look into Inline::Java.

 ___
 Robin Berjon [EMAIL PROTECTED] -- CTO
 k n o w s c a p e : // venture knowledge agency www.knowscape.com
 ---
 drug, n: a substance that, injected into a rat, produces a scientific paper.




Java.pm

2001-04-10 Thread cbell


Hello everyone, has anyone had any experience with Java.pm?  There
doesn't seem to be much info in the mail archives.  I'm trying to access
a JAR from within perl using the Java.pm, but I always receive the
error: 'java.lang.ClassNotFoundException'.  I can access the jar from a
Java script at the command line, so the problem is from within Perl
itself.

I've tried the following two methods but always end up with the same
results...

my $class = $java-java_lang_Class("forName","Test");
my $return_value =
$java-static_call("MyStaticClass","function_name",@params);

I can't find any examples in the archives to help me set this up
properly.  If anyone has had any experience with this is would be
greatly appreciated.  I'm running Modperl 1.24_01, Apache 1.3.14, and
jdk1.3.0_02 from Sun.

Thanks in advance,
Chris.



execute JAR procedures

2001-04-06 Thread cbell

Hello everyone, I'm looking for a way to execute JAVA procedures in a
JAR file from my modperl programs.  I have a couple .jar files that I
would like to import somehow into my perl scripts, and then be able to
execute the functions in them.

I've been looking through the Jakarta and Tomcat stuff but it seems like
overkill, this is the only JAVA I am using right now and was hoping
there was a simpler way.

My configuration is:  Redhat 6.2, Apache 1.3.14, mod_perl 1.24_01, and
mod_ssl-2.7.1-1.3.14.

Thanks in advance,
Chris.




Obtaining results from trigger

2001-01-26 Thread cbell


Hello everyone, I was hoping someone could help me with this...

I'm running postgres 7.02 on redhat 6.2, apache 1.3.14 and mod_perl
1.24_01.  I'm also using perl modules DBI 1.14 and DBD-Pg-0.95 to acces
the Postgres database.

Everytime my inventory file gets updated, I would like to have the
quantity on hand returned to my perl script.  I set up the following
function to do this:

CREATE FUNCTION inv_lookup () RETURNS OPAQUE AS '
BEGIN
RAISE  NOTICE ''%'', NEW.qtyonhand;
RETURN new;
end;
'language 'plpgsql';

Then I create the trigger like this...

CREATE TRIGGER qty after inventory for each row execute procedure
inv_lookup();

If I do any sort of updates from within psql I get the correct data
which is the Qtyonhand field in this format:

NOTICE:  15

However, in my perl program, I'm unsure as to how to get this
information back.  The Postgres Documentation says that the results from

a Notice get sent back to the application, but I check the DBI-err,
DBI-errstr, and DBI-state and they are empty.  The result code for the

actual SQL command I run is just 1 for success.

Does anyone know how to get these results from within a perl scripts???
Thanks in advance for any help.

Chris.




Re: File Upload problems

2000-12-29 Thread cbell

I think that was it!!! I wasn't closing the file after uploading it,
thanks alot



"Alexander Farber (EED)" wrote:

 cbell wrote:
  Everytime I try to upload a file, the browser will
  stall a couple of times, and the file ends up on the server as a zero
  byte file.

 How about:

  # Upload Procedure
  my $buffer;

   my $inputfile = upload ('uploaded_file');

   open (OUTFILE,"$ENV{DOCUMENT_ROOT}/images/test.gif")
  or die "Can not write to file because of $!";

  binmode OUTFILE;
  binmode $inputfile;
  while (read($inputfile,$buffer,1024))
  {
  print OUTFILE $buffer;
  } ## end while

   close OUTFILE;




File Upload problems

2000-12-28 Thread cbell

Hello everyone, I was hoping someone could give me a hand with file
uploads in mod perl.  Everytime I try to upload a file, the browser will
stall a couple of times, and the file ends up on the server as a zero
byte file.  I'm pretty sure this is a binmode problem,
and I've tried it a bunch of different ways, but nothing seems to work.
I've included the code for my upload form and my upload procedure.  If
anyone can shed any light on this problem I'd really appreciate it!!!
Thanks alot

# Display upload form
$query = new CGI;
print $query-start_multipart_form;
print $query-filefield('uploaded_file','file',50,256);
print $query-submit('SubmitUpload','Upload');
print $query-endform;

# Upload Procedure
my $buffer;
my $inputfile = param('uploaded_file');
open (OUTFILE,"$ENV{DOCUMENT_ROOT}/images/test.gif") ;
binmode OUTFILE;
binmode $inputfile;
while (read($inputfile,$buffer,1024))
{
print OUTFILE $buffer;
} ## end while




Re: File Upload problems

2000-12-28 Thread cbell

It is Mod perl 1.24_01, perl 5.005_03, and Apache 1.3.14 running on
Redhat 6.2.


"G.W. Haywood" wrote:

 Hi there,

 On Thu, 28 Dec 2000, cbell wrote:

  I'm pretty sure this is a binmode problem,

 Did I miss the bit where you told us which operating system, Perl
 version, and all that good stuff?  If you search around in the
 mod_perl directory you should find a file called SUPPORT.

 :)

 73,
 Ged.




Re: File Upload problems

2000-12-28 Thread cbell

I tried it with and without binmode with the same results, thats why I
figured I was using binmode wrong.


"G.W. Haywood" wrote:

 Hi there,

 On Thu, 28 Dec 2000, cbell wrote:

  It is Mod perl 1.24_01, perl 5.005_03, and Apache 1.3.14 running on
  Redhat 6.2.

 Hmmm.  Do you need to use binmode() at all?  If you didn't,
 then you probably wouldn't get any binmode problems...

 perldoc -f binmode

 73,
 Ged.




ssl

2000-12-08 Thread cbell

Hi everyone, does anyone have any suggestions as to which SSL package to
use?  I'm a little unsure if I should use Mod_ssl or Apache-ssl.  I'm
currently using Apache 1.3.12 if that helps...

Thanks alot!!!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Apache Session and Lock files

2000-11-29 Thread cbell

Hi everyone,

After tying a hash variable to a session, and writing to it, I would
like to undef my hash variable just to make sure that the session lock
file is deleted.  However, when I do this, then any changes I make to
the session hash don't get saved.  If I don't undef the session hash,
then the session data remains but I end up eventually with lots of lock
files in my tmp directory.

Has anyone run across this and come up with a solution.  I set Commit =
1 on my Tie command, and I commit changes to my database, but the data
still disappears if I undefine the hash.

Thanks in advance...


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




fixed length file database interface?

2000-11-10 Thread cbell

Hello everyone...

Does anyone know  of a database interface similar to DBD::CSV that works
with text files with fixed length fields/records




Retrieve OID from newly added record

2000-11-07 Thread cbell

Hello everyone, does anyone know how to retrieve the Object Identifier
(OID) from a record that was just inserted into a postgres database from
within perl?

These are the commands I'm using to insert the record:

$sth = $dbh-prepare("Insert into inventory Values ($id)");
$rc = $sth-execute;

$rc will tell me whether or not the insert was successful or not, but
that's it.

If I insert records from the psql utility, the OID is returned on the
screen after the insert, so I know it's there.  I just need to know how
to get it from within modperl.  I want to get this number so I can
insert a bunch of records in another file using the OID as the key.

Thanks in advance!




Retrieve OID from newly added record

2000-11-07 Thread cbell

Hello everyone, does anyone know how to retrieve the Object Identifier
(OID) from a record that was just inserted into a postgres database from

within modperl?

These are the commands I'm using to insert the record:

$sth = $dbh-prepare("Insert into inventory Values ($id)");
$rc = $sth-execute;

$rc will tell me whether or not the insert was successful or not, but
that's it.

If I insert records from the psql utility, the OID is returned on the
screen after the insert, so I know it's there.  I just need to know how
to get it from within modperl.  I want to get this number so I can
insert a bunch of records in another file using the OID as the key.

Thanks in advance!




Session data disappearing

2000-10-31 Thread cbell


Hi everyone, I'm sure this is a simple problem...
Im using Session.pm to track information between httpd requests.
However, when Istore some information in the session, it is gone
when I try to retrieve it later. I've noticed the following things:
when I tie to the session I use the command Commit = 1, but in
my error_log, I get the following...
Commit ineffective with AutoCommit enabled at /usr/lib/perl5/site_perl/5.005/Apache/Session/Store/Postgres.pm
line 92
Then I turned AutoCommit off on my database connection but then I could
see in my error_log that the commands were being rolled back.
I'll try committing the changes to the database next, but then what's
the point of the Commit = 1 command in the Tie command?? The documentation
states it has to be like this. Does anyone know what the proper way of
doing this is?
Also, thanks to all who replied to my last post!!! As you can
see I'm now up and running with Mod_perl
Chris


[Fwd: Session data disappearing]

2000-10-31 Thread cbell





I read that in the manual, but was a little unsure of what it meant.  I understand
the concept just not how to implement it.

Right now I'm just storing a variable in the hash.. For example...

$hash{test} = "test";

Then if I look at the variable from another script (or the same script) it's just
not there.

[EMAIL PROTECTED] wrote:

 Hi Chris, welcome on board !

   Are you changing data structures e.g. a element in a hash of hashes ?

   Apache::Session has documented behaviour where it only writes back changes
   if the top level variables have changed. If you are changing something
   deeper it will not be _seen_ as a change.

   The recommended approach is to use a timestamp at the top level to ensure
   that something always changes and forces a write.

   Simon Wilcox.

From   cbell [EMAIL PROTECTED]  Date
31 October 2000


 To
 [EMAIL PROTECTED]  Time  17:30


   Copy to (bcc: Simon Wilcox/BASE/WilliamsLea)

   Bcc Simon Wilcox/BASE/WilliamsLea

   Fax to

   Subject   Session data disappearing

 Hi everyone, I'm sure this is a simple problem...

 Im using Session.pm to track information between httpd requests.
 However, when I store some information in the session, it is gone when I
 try to retrieve it later.  I've noticed the following things:

 when I tie to the session I use the command Commit = 1, but in my
 error_log, I get the following...
 Commit ineffective with AutoCommit enabled at
 /usr/lib/perl5/site_perl/5.005/Apache/Session/Store/Postgres.pm line 92

 Then I turned AutoCommit off on my database connection but then I could
 see in my error_log that the commands were being rolled back.

 I'll try committing the changes to the database next, but then what's
 the point of the Commit = 1 command in the Tie command?? The
 documentation states it has to be like this. Does anyone know what the
 proper way of doing this is?

 Also, thanks to all who replied to my last post!!!  As you can see I'm
 now up and running with Mod_perl

 Chris

   
   Name: att1.htm
att1.htm   Type: Hypertext Markup Language (text/html)
   Encoding: base64
Description: Internet HTML

   

 __

This email contains proprietary information some or all of which may be
legally privileged.  It is for the intended recipient only. If an addressing
or transmission error has misdirected this email, please notify the author by
replying to this email. If you are not the intended recipient you must not
use, disclose, distribute, copy, print, or reply on this email.





Session data disappearing

2000-10-31 Thread cbell

I deleted the Sessions database and recreated it in Postgres and now the
session data is staying!!




Mod_perl, DBI, and Postgres install procedures...

2000-10-18 Thread cbell

Does anyone have a set of procedures to install Mod_perl, Apache,
Postgres, DBI, DBI.pm, and anything
else needed to make Modperl talk to a postgres database.  I'm new to
Linux and Mod_perl, and I've
followed all the setup procedures I can find to do this, but I still
cannot get a database connection.

I think I'm just missing a step somewhere, and if I can get the
procedures on how to do this from start to
finish from one source, I think I'll be allright.  I've been piecing
together all the information I've found on
the Internet, but I'm not having any luck.

Currently I'm receiving the error Can't locate object method "connect"
via package "DBI" at
/usr/lib/perl5/site_perl/5.005/Apache/DBI.pm in my error_log whenever I
start up the apache server.

I've tried installing using RPM's and using the source files, but I
always end up with a similar error.

Thanks in advance