Ok, lets start from the beginning, you're getting 1 file per 12 seconds,
roughtly 7200 files a day. Where does oracle come into this? You don't
really need oracle, you just need a directory and a way to generate unique
filenames. Then you can use grep or something scripted to massage them and
figure out what you want to keep.
Now, if you want to store the files in oracle and then use the oracle text
index on clobs to do keyword searching for stuff, then you're going to need
to connect to oracle somehow and put the files into the database. Since the
files aren't too large you shouldn't have problems with the version of
oracle, but you will have problems with the intermedia text index (it's
called something else now, but I forget what the current name is). The
index won't auto-update, so you'll have to make a dml call to update the
index. You'd probably only want to do this prior to when you're going to
work with the files.
Now, you need the servlet/jsp handling the uploads to be able to access
oracle, not tomcat. Tomcat could but doesn't need to come into the picture,
up to you. Either way, assuming you're going to put the files into oracle,
you're going to need a connection. You could do that simply by putting the
required code into the jsp/servlet, which would look something like this:
Class.forName( "oracle.jdbc.driver.OracleDriver" );
Connection con = DriverManager.getConnection(
"jdbc:oracle:thin:@127.0.0.1:1521:CTMC", "user", "pass" );
At this point you're going to have a connection. If you want to go the
datasource route you're going to have to ask someone else, I haven't setup
tomcat to provide the connection. Anyway, once you have the connection
you're going to write into the clob, which will look like this:
con.setAutoCommit( false );
Statement s = con.createStatement();
s.execute( "insert into clob_table ( id, clob ) values ( 1,
empty_clob() )";
ResultSet rs = s.executeQuery( "select clob from clob_table where id = 1
for update" );
if ( rs.next() ) {
oracle.sql.CLOB c = ( oracle.sql.CLOB ) rs.getClob( 1 );
java.io.PrintStream out = new java.io.PrintStream(
c.getAsciiOutputStream() );
out.println( file_data );
out.close();
}
s.close();
con.commit();
Now in some cases you'd want to use a different transactionIsolation mode,
the one you'll need to use when working with clobs under oracle is
READ_COMMITED. If you use SERIALIZED you'll have intermittent problems
(most likely, but not in all cases).
Does this answer your questions?
--mikej
-=-----
mike jackson
[EMAIL PROTECTED]
> -----Original Message-----
> From: Swapneel Dange [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 19, 2003 4:49 PM
> To: [EMAIL PROTECTED]
> Subject: RE: JDBC & ORACLE implementation !
>
>
> hi mike !
>
> the files i am using are quite small in size like 200-300 KB but
> sometimes i
> get files of the size 1MB or so. but the rate at which i get
> these files is
> huge, i get a file every 12 second so that makes 7200 files a day and all
> are useful files. i will then massgae the files and strip them of the
> un-necessary details. and then look out for keywords in the file.
> draw some
> conclusions based on that and then implement the solutions.
>
> moreoevr i could not understand as to what u wanted to convey through the
> sentense," So, you don't really need tomcat per say to talk to
> oracle, you
> need your>servlets/jsps to be able to talk to oracle. " . i am a NOVICE,
> thats the reason that i didnt understans the meaning of the
> sentense there.
> anyways i can user the other JDBC drivers which are not supplied
> by ORACLE.
> some of the drivers suggested to me here are the ones by DATADIRECT.
>
> awaiting reply !
>
> Swapneel Dange
> 505-642-4126
> http://www.cs.nmsu.edu/~sdange
>
>
>
>
>
>
>
>
> >From: "Mike Jackson" <[EMAIL PROTECTED]>
> >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >Subject: RE: JDBC & ORACLE implementation !
> >Date: Wed, 19 Feb 2003 16:24:25 -0800
> >
> >So, you don't really need tomcat per say to talk to oracle, you need your
> >servlets/jsps to be able to talk to oracle. What type of data are you
> >working with and how big is it? That's really the question to
> ask that'll
> >tell you what version of oracle to use. If you using small data
> (standard
> >types or lobs) then any version should work ok. But you'll want to be in
> >the READ_COMMITED transaction isolation mode (default). If
> you're working
> >with large lobs (>25 megs) you'll probably want to be on 9.2.0.1.0 or
> >better
> >(or a patched 9.1, but not an 8.x version I think). And you'll want to
> >make
> >sure you're using the jdbc driver supplied by the database, or one from a
> >newer version, the older ones with newer databases tend to cause
> problems.
> >Personal/Standard/Enterprise may not matter.
> >
> >--mikej
> >-=-----
> >mike jackson
> >[EMAIL PROTECTED]
> >
> > > -----Original Message-----
> > > From: Swapneel Dange [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, February 19, 2003 4:11 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: JDBC & ORACLE implementation !
> > >
> > >
> > > hi !
> > >
> > > frankly speaking, i am very new to the database concepts. i am
> > > trying to use
> > > the "Oracle Database Personal Edition" for my use here. But i can
> > > tell about
> > > the version of the TOMCAT, i am using , its 3.3.1a. if u
> could tell me
> >in
> > > detail as to what ORACLE product i should use will be great.
> > >
> > > By the way i am using this database for the users to send data from 3
> > > different states on the webserver i am running here. so that when
> > > that data
> > > which are huge files coem over here, i can massage them and get the
> > > particular details i want for my use.
> > >
> > > thanx !
> > >
> > > Swapneel Dange
> > > 505-642-4126
> > > http://www.cs.nmsu.edu/~sdange
> > >
> > >
> > >
> > >
> > >
> > > >From: "Andoni" <[EMAIL PROTECTED]>
> > > >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > > >To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > > >Subject: Re: JDBC & ORACLE implementation !
> > > >Date: Wed, 19 Feb 2003 10:09:16 -0000
> > > >
> > > >The implementation is based on which driver you use, which
> > > mostly depends
> > > >on
> > > >which version of Oracle you are running.
> > > >
> > > >What version numbers are you using for Oracle & Tomcat
> > > >
> > > >----- Original Message -----
> > > >From: "Swapneel Dange" <[EMAIL PROTECTED]>
> > > >To: <[EMAIL PROTECTED]>
> > > >Sent: Wednesday, February 19, 2003 9:47 AM
> > > >Subject: JDBC & ORACLE implementation !
> > > >
> > > >
> > > > > hi there ~
> > > > >
> > > > > i am curious to know as to how can u implement ORACLE database in
> >the
> > > > > TOMCAT. and can somebody tell me as to where i can read the
> > > >DOCUMENTATION
> > > > > for the implementation of the JDBC connectivity under TOMCAT.
> > > > >
> > > > > Swapneel Dange
> > > > > 505-642-4126
> > > > > http://www.cs.nmsu.edu/~sdange
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > _________________________________________________________________
> > > > > MSN 8 with e-mail virus protection service: 2 months FREE*
> > > > > http://join.msn.com/?page=features/virus
> > > > >
> > > > >
> > > > >
> >---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > > _________________________________________________________________
> > > Protect your PC - get McAfee.com VirusScan Online
> > > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]