Hi everyone,
i m new to struts.. if anyone can tell me where to find the archive of the
mailing lists then the problems already discussed won't come again and
again...
anyway i would like to know how to define datasource in struts... i tried
using the example given with struts... but i mu
)
-Ursprüngliche Nachricht-
Von: Bradley Cowen [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 21. August 2001 01:36
An: [EMAIL PROTECTED]
Betreff: RE: cannot find the datasource in struts?
I can show you an example of what i'm using (MySQL):
In struts-confi
ublic ActionForward perform(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
Connection connection = null;
DataSource dataSource = null;
Stat
a newbie in using struts...
kindly let me know what i should be doing to define a datasource..
i have the struts-config.xml file where i defined the datasource
parameters...
and now i m trying to run the example provided in the struts
but it is throwing error javax.sql.DataSource not found
Hi
How do I implement a JDBC Database Access class ?
Do I have to use the ActionServlet class because of the needed method
"findDataSource" ?
Thanks in advance
Stefan
Hi Kent, Luis,
I do agree that a datasource should be in the logic
layer, not in the JSP/prsentation layer, but I have a
problem to populate the JSP combo box with data that
is retrieved from the database when they first logn
the page. And I think getting a datasource here is
good enouhg :) . Do
Why don't you put it inside a Custom Tag? That way you don't put it in the
presentation layer.
I think with the code sample that Craig shows us is possible.
<%
DataSource ds = (DataSource)
application.getAttribute("org.apache.struts.action.DATA_SOURCE");
...
%
Binh,
Why would you want to get a DataSource from a JSP page? I would not
recommend using a DataSource at the presentation level. Normally, you would
get the data from the action class and store it in the session so that your
presentation layer can use it. It is much easier that way, and a
On Mon, 13 Aug 2001, BinhMinh Nguyen wrote:
> Hi,
>
> I know how to get a DataSource from a Action java
> class
> but I do not know how to obtain a DataSource from a
> JSP page.
> Please show me how.
Doing this violates the usual separation of business logic and appli
On Thu, 2 Aug 2001 [EMAIL PROTECTED] wrote:
> I understand that--my app does "close" connections (release back to the
> pool). The problem is that the pool itself maintains open connections to
> the database, and doesn't seem to recover very well when the databsae dies
> and comes back.
>
epository using JNDI for use by the persistenc layer?
>
> That is the solution we think will work. Is this different from that?
>
> Thanks,
> Bud
>
> >DataSource can be obtained either Deployment descriptor as
> >"java:comp/jdbc/MyDataSource"
> >(assoc
2/2001 11:31 AM
Please respond to struts-user
To: [EMAIL PROTECTED]
cc:
Subject: RE: DataSource timeouts?
in the documentation it says that you close the connection after you have
used it...
ie.
conn.close();
this wont close the connection but will release it fo
: [EMAIL PROTECTED]
Subject: DataSource timeouts?
Is there any parameter that can be set to timeout datasources, or to
re-init them after a specified period of time? We recently bounced our
Oracle database that our struts connection pool points to, and I noticed
that all the connections had
Is there any parameter that can be set to timeout datasources, or to
re-init them after a specified period of time? We recently bounced our
Oracle database that our struts connection pool points to, and I noticed
that all the connections had hung (the app just hung while trying to
perform que
For some reason, my application cannot load
ActionServlet if we use Connection Pooling using
DataSource in the struts-config.xml, Please help me
spot my error. Thank you.
B Nguyen
--
strut-config.xml:
http://jakarta.apache.org/struts/dtds
> Take a look to the Castor project -
> http://castor.exolab.org
That does indeed look awesome! Do you have experience with it? Is it
ready for production use? Many thanks for that great hint!
Andreas
solution we think will work. Is this different from that?
Thanks,
Bud
>DataSource can be obtained either Deployment descriptor as
>"java:comp/jdbc/MyDataSource"
>(associate a Jndi name to the Datasource
>)
>
Hello,
I am trying to add property to DataSource object. There is addProperty(
String, String) method that I used but it had no affect. My impression is
that all connections are initialized after ActionServlet is loaded ( I
extended ActionServlet and added properties after calling super.init
DataSource can be obtained either Deployment descriptor as
"java:comp/jdbc/MyDataSource"
(associate a Jndi name to the Datasource
)
- Original Message -
From: Andreas Leitner <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; 'Aapo Laakkonen'
<[EMAIL PROTECT
AL> This pattern also comes in handy, when you have classes that inherit
AL> from Person. If the DB access would happen in the constructor, one could
AL> only create Person objects, with a factory, you can create an object of
AL> the real type instead.
AL> Anyway, what I want is to
constructor, one could
only create Person objects, with a factory, you can create an object of
the real type instead.
Anyway, what I want is to get a DataSource without knowing about a
servlet. Is this somehow possible? Is there some static access to the
DataSource Repository?
Tia,
Andreas
Hello,
Did anyone encounter the following error while trying to load datasource for
Sybase jconnect 5.2? How did you resolve it? Is there a property that would
indicate for not checking for metadata accessor info?
===
2001
On Thu, 12 Jul 2001, Maik Mrazovic wrote:
> thanks,
>
> but it´s indifferent if Autocommit is "false" or "true" it does not
> work with both options!
>
> Database is IBM DB2 7, but the reason for my problem ist the
> connection-object from the datasour
thanks,
but it´s indifferent if Autocommit is "false" or
"true" it does not work with both options!
Database is IBM DB2 7, but the reason for my
problem ist the connection-object from the datasource-config.
regards,
Maik
- Original Message
Check
your autocommit mode
Regards
-Original Message-From: Maik Mrazovic
[mailto:[EMAIL PROTECTED]]Sent: Thursday, July 12, 2001
1:30 PMTo: [EMAIL PROTECTED]Subject:
Problems with Database because of Datasource-Config of
Struts!
Hello,
all parameters for a
the Connection Object with
java.sql.Connection myConnection =
null;
try
{ javax.sql.DataSource
dataSource = this.getServlet().findDataSource(null);
if (dataSource !=
null)
{
myConnection = dataSource.getConnection();
...
and so on
this error
when you try to open your connection.
Hope this helps.
--
Martin Cooper
- Original Message -
From: "Bill Clinton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2001 1:47 PM
Subject: Struts Datasource problem
> Hello,
>
Hello,
I am having a recurring problem with struts and jdbc. The demo
driver I am using, inet's Sprinta200, only allows 2 connections. I have
my data source max set to 1, but I still get errors from the driver:
java.sql.SQLException: [TDS Driver]Too many connections :3
at com.inet.tds.e.
Hi,
I want to use a datasource in a Struts based application but I also want
to lookup this dataSource in objects that do not have an action or a
servlet object in their scope, f.e. DAO's. In this case, using the
struts-config.xml dataSource description doesn't seem the best of
sollut
What is the easiest way to set a timeout for a query
in the struts connection pool? I'm using Oracle 8
with the native driver.
David
__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
It was a small mistake
be the DATASOURCE. I do not get an error but it seems the
application is not connecting to the database. Has something changed in Datasource
definition in struts-config file.
This is what I have it defined as(and it works fine with 1/29/01 version):
Thanks in advance
-Nimmi
I'm kind of new to struts, but I have this working.
Your data source configuration in struts-config.xml looks fine. You can check
your logs to make sure no errors are thrown when you start your server (I use
Tomcat 3.2.1).
In your code you set up datasource, as below:
javax.sql.DataS
JOEL VOGT writes:
> Hopefully this is an easy question for somebody.
> In my struts-config I have the datasource
>
> autoCommit="false"
> description="Access data source config"
> driverClass="sun.jdbc.od
Hello,
We at Tufan Infotech are evaluating Struts for using in our web application
development.
I am not able to connect to a Oracle 8i database and retrieve or update
data. The datasource configuration in struts-config.xml is given below.
The code snippet which tried to connect
kartik!
url depends on driver class used.
piyush
Kartik Sudarsan wrote:
> i think the problem lies in your url. i have implemented datasource in my
> application using datasource and this is what my url looks like
> jdbc:oracle:thin:@sandstorm:1521:testdb
> here sandstorm is
i think the problem lies in your url. i have implemented datasource in my
application using datasource and this is what my url looks like
jdbc:oracle:thin:@sandstorm:1521:testdb
here sandstorm is the name of the machine on which the database is
and testdb is the global database name
i
What specific operation are you trying to do? Since you don't have autocommit
set to true, you may be having transaction problems.
I found it helpful to create a Test.java file with the same operations
as creating the datasource (with the same parameters), a connection and
doing a s
Hi all,
Hopefully this is an easy question for somebody.
In my struts-config I have the datasource
later on in a servlet I have
javax.sql.DataSource dataSource = servlet.findDataSource(null);
con = dataSource.getConnection();
When I try to use this however, I get an java.sql
PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Matthias Bauer
Sent: Friday, March 16, 2001 4:45 PM
To: Kartik Sudarsan
Cc: [EMAIL PROTECTED]
Subject: Re: datasource - connection timeout
Here is the change in class GenericDataSource: I am just checking whether
the
connection has been closed by the
>
> }
>
> // We have timed out awaiting an available connection
> throw new SQLException
> ("getConnection: Timeout awaiting connection");
>
> }
>
Kartik Sudarsan wrote:
>
> hi,
> i saw your posted me
> My problem is that
> access to the DataSource is through the servlet.findDataSource() call.
Struts stores the JDBC Connection pools as servlet context attributes
(in JSP terms, application-scope beans). You can also access them that
way. If you do not specify a name in the Struts-confi
Title: Question about struts application model (DataSource, Business Logic beans)
Hi,
I'm using Struts for a new application that I'm developing. I have a question about the separation between the Action classes and the Business Logic beans.
My Business Logic beans are makin
base accesses to manipulate the
> underlying data model. I am planning on using the struts db connection pool,
> which is supplied through the DataSource. My problem is that access to the
> DataSource is through the servlet.getDataSource() call. How do I make the
> Business Logic
and your DataSource. I modeled my context
object after the Servlet session API, but you could make it much more
structured if you like.
Second, depending on your servlet environment, create some mechanism to
initialize your application context object. Using Tomcat, you could do
this using
Title: Question about struts application model (DataSource, Business Logic beans)
Hi,
I'm using Struts for a new application that I'm developing. I have a question about the separation between the Action classes and the Business Logic beans.
My Business Logic beans are makin
So i propose a new interface:
interface StrutsDataSource extends DataSource
{
open()
close()
setProperty(String str,String)
}
those property can be everything: url,driver class ect ect
exactly the things that can be specified in the struts-config.xml
Then the implementor must map the s
But the problem is that i am writing a Web app at this time.
And i want it to run on both environments. (A normal JSP/servlet container and a J2EE
container)
Because i want it to run on both environments i must just the lowest common
denominator (do i say this right?)
And that is using a Dataso
Johan Compagner wrote:
> > As I pointed out in a subsequent message on this thread ... you
> > need to avoid the use of the initialization service
> > if your container requires context attributes to be serializable.
> > In such cases, the app server will provide an alternative means
> > (JNDI I
> As I pointed out in a subsequent message on this thread ... you
> need to avoid the use of the initialization service
> if your container requires context attributes to be serializable.
> In such cases, the app server will provide an alternative means
> (JNDI InitialContext) to gain access to t
ed to
update the README to be more explicit about this.) If you are just
compiling your own classes, you should not need them, but will again at
runtime (even if you do not use a DataSource in your app.
Craig
Pardon me if I'm missing something, but is it intended that the
javax.sql.DataSource be required in the ActionServlet? It's just that I
downloaded a recent build and I'm now getting errors when trying to compile
my actions. They relate to javax.sql.DataSource not being found on the
import. Is
Does a datasource object always have one Driver and url for it's connections?
(and the username and password can change)
If so than i find that stupid, because it is possible that i must access multiple
databases
from my applications.
And in struts i can only define one. (at this time i
301 - 353 of 353 matches
Mail list logo