Thanks for your response...
But do you have any example for this case ?
On 11/4/02 9:33 AM, David Graham [EMAIL PROTECTED] wrote:
You can create a DataSource in a plugin or the ActionServlet and store it in
the ServletContext for later retrieval.
David
From: Kwon Yu [EMAIL
You can look at the Struts source to see how it does it.
David
From: Kwon Yu [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: How to configure Datasource externally
Date: Mon, 04 Nov 2002 09:38:58 -0600
since usually a datasource is extracted from JNDI.
Petit, Yannick (FR, Ext:Oxymel) wrote:
Hi,
I'm new to struts, and looking for it to decide use it or not for our new
Dev in J2ee MVC² Project.
Our most imprtant requirement is to interact with Oracle (8i) Database so
for powerfull Apps ( Large
Hi,
I'm new to struts, and looking for it to decide use it or not for our new
Dev in J2ee MVC² Project.
Our most imprtant requirement is to interact with Oracle (8i) Database so
for powerfull Apps ( Large Corporate Intranet) we planned to use the Oracle
JDBC Datasource and most particularly
velocity the correct name of the datasource.
Anyone have some insight as to how to configure velocity to find the same
datasouce that struts is using. My struts config has the typical
data-sources
data-source
set-property property=description value=App Name/
!--set-property property=key value
Hi, there!
How can I easily achieve database connection pooling (using a datasource
in one of the xml config files - btw. which one is it?)?
I know there is some stuff in jakarta-commons.
What I want to achieve is an easy to configure and highly efficient db
connection pool that is available
]
Subject: How to use datasource and db connection pooling in struts?
Hi, there!
How can I easily achieve database connection pooling (using a datasource
in one of the xml config files - btw. which one is it?)?
I know there is some stuff in jakarta-commons.
What I want to achieve is an easy
, Nayan (N.) [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 10:42:13 -0400
you can use commons-dbcp ... see
http
struts-config.xml is where you define your datasources. You specify the key
to store the DataSource object under in the application scope so your
actions can find it later. You also have to specify the DataSource
implementation class to use. Often this will be provided by your database
PROTECTED]]
Sent: Dienstag, 15. Oktober 2002 16:42
To: 'Struts Users Mailing List'
Subject: RE: How to use datasource and db connection pooling in struts?
you can use commons-dbcp ... see
http://jakarta.apache.org/commons/dbcp.html
---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com
You can specify this in your struts-config.xml file for each webapp.
Dave
From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002 17:14:29 +0200
If I'm
to use datasource and db connection pooling in struts?
struts-config.xml is where you define your datasources. You specify the
key
to store the DataSource object under in the application scope so your
actions can find it later. You also have to specify the DataSource
implementation class to use
For that one you need to play RTFM with your server docs. It should be
possible, but the way you do it would be container-dependant. Tomcat
will place a reference into JNDI for you - I assume (dangerous as it is)
other will too. If you are using a different server than Tomcat, and it
the pool in the
context. But with JNDI this should be easier.
Stef.
-Original Message-
From: Eddie Bush [mailto:[EMAIL PROTECTED]]
Sent: Dienstag, 15. Oktober 2002 17:29
To: Struts Users Mailing List
Subject: Re: How to use datasource and db connection pooling in struts?
For that one you need
Yep, this is container dependant. Moving to OT thread...
Dave
From: Eddie Bush [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: How to use datasource and db connection pooling in struts?
Date: Tue, 15 Oct 2002
[EMAIL PROTECTED] wrote:
If I'm getting this right, I could for instance configure tomcat
(server.xml) to use this, and it will then be available in my webapp?
Yes. See the HOWTOs on the site.
Is there a way to configure in the web app itself? (web.xml or
something?)
see the site docs I
I use Tomcat 100% of the time, so, no, I don't have code to initialize
the data-source. Sorry :-(
A ContextListener would also be another approach I forgot to mention.
That's a servlet spec 2.3 thing - and would be even further independent
of the particular app. Once written, you could
I spent much of yesterday using Google to glean information about
configuring Struts (w/ Tomcat in my case) to use a datasource. As Eddie
Bush points out in a prior post options for initializing a datasource (with
or without a connection pool) include:
1. Tomcat JNDI service via server.xml;
2
and/or
application specific approach.
Dave
From: Bradley G Smith [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Datasource Access Options (was Connection Pooling)
Date: Tue, 15 Oct 2002 09:15:51 -0700
I spent much of yesterday
Hii All,
Any one know how to get multiple Datasource from Struts.
Because i think in Struts-config.xml, we are able to specify only one
Datasource.
Also I got an error when I configure my datasources in tomcat's
sever.xml context /context I couldnt able to get that datasource
Hii All,
Any one know how to get multiple Datasource from Struts.
Because i think in Struts-config.xml, we are able to specify only one
Datasource.
Also I got an error when I configure my datasources in tomcat's
sever.xml context /context I couldnt able to get that datasource
You can define multiple datasources in struts-config.xml by having mulitple
datasource elements inside the datasources element. You need to give
each datasource a unique name (or key) so that you can retrieve them from
the ServletContext to use them. See the struts dtd for the syntax
Hi,
I'm experiencing this same problem. If you have a solution, please post.
Thanks,
Tuan
-Original Message-
From: Kalaiselvan [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 30, 2002 2:18 AM
To: Struts Users Mailing List
Subject: About Datasource
Hii All,
Any one know
property=user
value=your password /
/data-source /data-sources
Then in your Action you can reference the data-source by
ds = (DataSource)
servlet.getServletContext().getAttribute(DataSource1); // or DataSource2,
etc.
HTH,
Jerry
-Original Message-
From
Hi all:
I want to use the connection pool from Struts, then I declare a datasource
in the config-struts.xml. Following the user guide instruction I use de
servlet.getDataSource(null) method to recover it, but it's deprecated (I'm
using struts 1.1 beta2). I have read in a message from the list
[mailto:[EMAIL PROTECTED]]
Sent: Friday, September 20, 2002 5:37 AM
To: Struts Users Mailing List
Subject: DataSource in Struts 1.1 beta2
Hi all:
I want to use the connection pool from Struts, then I declare a datasource
in the config-struts.xml. Following the user guide instruction I use de
Hi Miguel,
This question was already answered: look for the subject datasource
retrieval (6/09/2002).
Then, in your action, you can access your datasource via:
execute(..)
{
DataSource ds = this.getDataSource(request);
}
...
...
Julio Cesar
SOFTSITE
Hi David, all:
When I leave the Datasource section out of the config file, my page loads with no
problem. It is the page in which the
user will type his/her username and password.
Also, Balaji Thirugnanam asked about the App Server: I'm using Tomcat 3.2.4 and Struts
1.0.2
Thanks!
Alex
What happens if you leave everything out of struts-config except the
datasources section and then try to use the datasource for a simple query?
You can get the datasource from the ServletContext like this to try it out
without any struts actions:
// from any servlet do this
DataSource ds
/sql/DataSource
at
com.honeywell.fixedasset.test.DataSourceTest.processRequest(DataSourceTest.java:55)
at com.honeywell.fixedasset.test.DataSourceTest.doGet(DataSourceTest.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740
Users Mailing List'
Subject: RE: DataSource
Here we go again...
I did what you suggested and I got a new error message. I must confess I
don't know what to do next :(
Here's the error message:
Error: 500
Location: /fadd/servlet/com.honeywell.fixedasset.test.DataSourceTest
Internal Servlet Error
I knew I could count on the list! Thank you all!!
Alex
-Original Message-
From: Dimitar Stavrakov [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 5:41 PM
To: 'Struts Users Mailing List'
Subject: RE: DataSource
Hi Alex,
Make sure that that class (javax.sql.DataSource
Hi!
Introduction
-
I'm trying to use the DataSource implementation in Struts so that I can have database
Connection pooling. However, every
time I try and load the logon.jsp page I get an error :(
Any thoughts?
Details
-
Here's my struts-config.xml so far
The error message doesn't indicate anything wrong with the datasource. what
happens when you leave that part out of the config file?
Dave
From: Silva, Alejandro [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject
Possible knock out's would be the classloaders. Which AppServer are you
running on ?
-B
Silva, Alejandro wrote:
Hi!
Introduction
-
I'm trying to use the DataSource implementation in Struts so that I can have database
Connection pooling. However, every
time I try and load
From ActionServlet.findDatasource() API docs:
Deprecated. Look up data sources directly in servlet context attributes
So I replaced my call to :
dataSource = getServlet().findDatasource(null);
with:
dataSource =
(DataSource)getServlet().getServletContext().getAttribute(this.DATA_SOURCE_KEY
List' [EMAIL PROTECTED]
Subject: RES: Datasource Retrieval in 1.1 (Help needed)
Date: Fri, 6 Sep 2002 12:07:52 -0300
Hi Craig,
This question was already answered, look for the subject Connection
Pool Question(15/08/2002). Anyway, the code...
Then, in your action, you can access your datasource
The documentation still lists the old way of how to retrieve a datasource
which has been setup in struts-config.xml using findDatasource();
The API says to use datasource stored in attributes. Can someone give an
example of how I might do this from within my execute method? I want to get
Ok, read the DTD for struts-config.xml and figured out that I would use the
key attribute if I were to add another datasource. I would still like to
know how to retrieve the datasource without using the deprecated
findDatasource() method.
Thanks,
Craig.
From: Craig Tataryn [EMAIL
: datasource classpath issue with MySQL driver
You might want to try a newer version of the MySQL JDBC Driver. I'm
using 2.0.14 and it works fine in Tomcat. Also, I register it with
Tomcat via JNDI (server.xml) and then look it up in my classes.
HTH,
Matt
--- In [EMAIL PROTECTED], Clay Graham
Mailing List
[EMAIL PROTECTED]
alexander.jesse cc:
@csfs.com Subject: RE: datasource classpath issue
with MySQL driver
]]
Sent: Tuesday, July 02, 2002 5:44 AM
To: Struts Users Mailing List
Subject:RE: datasource classpath issue with MySQL driver
I've had this problem as well, even after I unzipped the jar file. I put it
out on the list twice and never got much response. You can try different
versions
goodness.
So my first step was to add the datasource in my struts-config.xml as
follows:
data-sources
data-source
set-property property=autoCommit
value=false/
set-property property=description
value=The Test Datasource/
set
my first step was to add the datasource in my struts-config.xml
as
follows:
data-sources
data-source
set-property property=autoCommit
value=false/
set-property property=description
value=The Test Datasource
Hi,
I'm trying to create a simple DataBase app. using Struts. Right now i have a problem
with getting the DataSource out of the InitialContext and i'm not sure what i'm doing
wrong or maybe it has something to do with the Struts Servlet.
In configured the server.xml as follows:
Resource name
- Original Message -
From: Maarten Roosendaal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 14, 2002 3:42 PM
Subject: DataSource problem
Hi,
I'm trying to create a simple DataBase app. using Struts. Right now i have a
problem with getting the DataSource out
it up in web.xml to load AFTER Struts ActionServlet
when the webapp is started. I hoped I could somehow get the DataSource
via ActionServlet.findDataSource(), the only widely-documented way to
get it. I would then pass this DataSource to a configuration singleton
class in model-land for use
Hi Jeff
I'm at the same point as you in developing an app. I'm going to use the
Jakarta commons-dbpc commons-pool.
I find your description of passing DataSource into model at init time
ambiguous - surely you don't have any model components hanging around in
sessions or application scope? You
Adam Hardy wrote:
Hi Jeff
I'm at the same point as you in developing an app. I'm going to use the
Jakarta commons-dbpc commons-pool.
Thanks for the tip. I will probably try the commons-dbpc later on.
That's the beauty of a standard interface like DataSource, the
implementation can
()
function of business logic.
- Business logic consults database (with Connection from DataSource
cached in 'registry')
- (If password is correct), login() returns new UserBean Object
- Login Action installs UserBean Object in session scope, then
forwards to next page
- JSP components read whatever
On Fri, 31 May 2002, Jeffrey Keays wrote:
Date: Fri, 31 May 2002 20:05:37 +0900
From: Jeffrey Keays [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Passing DataSource into Model-land at init
Adam Hardy
Subject: DataSource con.close() question
From: David Bolsover [EMAIL PROTECTED]
===
Hi
I have a datasource defined in the struts-config.xml file.
The datasource connects to the source database fine.
Enrty in struts-config.xml:
data-source key=Centura
set-property property=autoCommit value
go to sourceforge.net and search for it
On Thursday 04 Apr 2002 4:22 am, you wrote:
On Tuesday, April 2, 2002, 7:42:27 PM, someone wrote:
How is Poolman better than the database connection manager
included with struts? Speed? Reliablity?
I'm curious about this also. Also, where can I
I have been unable to access a database as suggested in
struts-example.war. I started with a working example that does not
access a database, and made a single change: I added a datasource
element to struts-config.xml. When I did that, the example at the first
attempt to access the action
On Tuesday, April 2, 2002, 7:42:27 PM, someone wrote:
How is Poolman better than the database connection manager
included with struts? Speed? Reliablity?
I'm curious about this also. Also, where can I get Poolman and
documentation if the site is down I'm looking for fairly robust
Hi:
Does anybody know when this error occurs?
Caused by: javax.naming.ServiceUnavailableException. Root exception is
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested
exception is:
java.net.ConnectException: Connection refused: connect
I haven't used poolman, but isn't the problem with it that it is no longer
being developed?
Niall
-Original Message-
From: hemant [mailto:[EMAIL PROTECTED]]
Sent: 01 April 2002 23:12
To: struts
Subject: Struts Basic/Pooling DataSource Vs Poolman
I currently use poolman in my
: Struts Basic/Pooling DataSource Vs Poolman
I haven't used poolman, but isn't the problem with it that it is no longer
being developed?
Niall
-Original Message-
From: hemant [mailto:[EMAIL PROTECTED]]
Sent: 01 April 2002 23:12
To: struts
Subject: Struts Basic/Pooling
Subject: Re: Struts Basic/Pooling DataSource Vs Poolman
From: Vic Cekvenich [EMAIL PROTECTED]
===
Poolman is very popular. Don't worry.
Vic
Niall Pemberton wrote:
I haven't used poolman, but isn't the problem with it that it is no longer
being developed?
Niall
-Original Message
How is Poolman better than the database connection manager included with struts?
Speed?
Reliablity?
On Tue, 2 Apr 2002 08:29:07 -0500
hemant [EMAIL PROTECTED] wrote:
Yes, but Iam sure it will be back. It is too good to be shelved. The current
version (v2.1) works fine for me.
All,
I have been migrating a smaller Tomcat/MySQL application to Struts and
have
run into a problem.
I have completely converted the app to Struts and hit a snag when I
inserted
the DataSource tag into the struts-config.xml. It began to generate
Cannot
find ActionMappings errors
Message-
From: stephen.chambers [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 2:42 PM
To: [EMAIL PROTECTED]
Subject: Big problem with tomcat's security manager and dataSource in
the struts_config.xml file
All,
I have been migrating a smaller Tomcat/MySQL application to Struts
Difficult to say, as I am using the DataSource tag in the struts-config.xml file. I
would assume it uses the first call, the one with multiple arguments, but I am not
sure. Are you running tomcat with security?
Steve
From: Tim Sawyer [EMAIL PROTECTED]
Date: 2002/04/01 Mon AM 08:50:50 CST
I currently use poolman in my webapp. I was wondering if anyone got a chance to play
with the classes in commons-dbcp.jar.
How different are these from poolman?. I still dont think that Struts classes provide
features such as resultset cache, periodic update of the cache with new data, query
All,
I have been migrating a smaller Tomcat/MySQL application to Struts and have run into a
problem.
I have completely converted the app to Struts and hit a snag when I inserted the
DataSource tag into the struts-config.xml. It began to generate Cannot fond
ActionMappings errors in the html
All,
I have been migrating a smaller Tomcat/MySQL application to Struts and have
run into a problem.
I have completely converted the app to Struts and hit a snag when I inserted
the DataSource tag into the struts-config.xml. It began to generate Cannot
find ActionMappings errors in the html
I was compiling some classes then I got this error :
C:\tomcat401\webapps\jprostrut\WEB-INF\classes\com\mousetech\strutsdemojavac
*.
java
CategoryForm.java:110: cannot resolve symbol
symbol : class DataSource
location: package sql
javax.sql.DataSource ds = servlet.findDataSource( null
: Monday, March 18, 2002 10:03 AM
To: [EMAIL PROTECTED]
Subject: DataSource ??
I was compiling some classes then I got this error :
C:\tomcat401\webapps\jprostrut\WEB-INF\classes\com\mousetech\s
trutsdemojavac
*.
java
CategoryForm.java:110: cannot resolve symbol
symbol : class DataSource
Is it possible to obtain a reference to the built-in struts datasource from a custom
action?
If so, is there something I could reference on how to do it? I haven't been able to
find anything.
Thanks so much!
Eddie
);
Locale locale = getLocale(request);
MessageResources messages = getResources();
DataSource dataSource = (DataSource)
servlet.getServletContext().getAttribute(org.apache.struts.action.Action.DAT
A_SOURCE_KEY);
Gr
Ronald
-Original Message-
From: Eddie Bush
, 2002 7:59 AM
Subject: RE: Getting DataSource from an Action
sure there is:
public ActionForward perform(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
// Extract attributes we will need
Dave, which version of struts are you using?
Here is how I access my datasource with a nightly build from ~ Jan 20.
data-sources
data-source
set-property property=autoCommit
value=false /
set-property property=description
value=example
Mike:
Use the Websphere datasource!!! I've had a plethora of stability
problems when it came to using the struts datasource on websphere. I've
defined my datasource in struts for client development only. And do,
you don't miss out on any features of struts if you use datasource
management
by replacing my home-grown datasource manager.
I am using WebSphere, so presumably I don't need pool man. Datasources are
defined in a property file (not xml, but good enough) and are cached. I
also like the idea of having datasources defined in a separate file.
Am I over-looking something? Will I
() {
return me;
}
private DataSource ds = null;
private Connection con = null;
/** Retrieves a connection from the connection pool */
//TODO: Throw a ServiceException, rather than Naming and SQL
public Connection getConnection
from a JSP as follows:
%@ page
import=javax.servlet.*,javax.sql.*,java.sql.*,org.apache.struts.*,org.apache.struts.action.*
%
%
DataSource dataSource = (DataSource)
getServletContext().getAttribute(Action.DATA_SOURCE_KEY);
Connection conn = dataSource.getConnection
, January 29, 2002 10:14 AM
To: [EMAIL PROTECTED]
Subject: Struts DataSource object - how much can be taken for given?
I have now progressed further, and run into a few questions which I
would
appreciate help with in order to be nudged in the right direction.
After a bit of work with the Struts basic
. Read the release notes for more info.
[EMAIL PROTECTED] wrote:
Hi,
I have had the experience that Struts DataSource times out frequently. I
tried to switch to Poolman, but I get the following error in trying out its
poolman-webapp:
java.sql.SQLException: SQLException occurred in JDBCPool
Hi,
I have had the experience that Struts DataSource times out frequently. I
tried to switch to Poolman, but I get the following error in trying out its
poolman-webapp:
java.sql.SQLException: SQLException occurred in JDBCPool: java.sql.SQLException:
Transaction Isolation Levels
Hi again,
Poolman was giving errors because I was using an older version of mysql-jdbc
driver. One must use 2.0.7 upwards to be compatible, I guess.
Pranav
On 18 Jan 2002 17:19:40 - [EMAIL PROTECTED] wrote:
Hi,
I have had the experience that Struts DataSource times out
.
Finally, may I suggest looking into Poolman as an alternative to the
struts connection pooling.
Marcus Blackhall wrote:
Hi All,
I am attempting to use MySQL as a datasouce for struts to make use of the
Connection Pool. I have in my struts-config.xml file the floowing for the datasource
-
From: Peter Kordel [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, December 17, 2001 9:17 PM
Subject: Re: using MySQL as a datasource
Try these things first:
Verify that you have the latest stable version of mysql - 3.23.46 I
think.
Get the latest driver
Hi All,
I am attempting to use MySQL as a datasouce for struts to make use of the
Connection Pool. I have in my struts-config.xml file the floowing for the datasource
data-sources
data-source
set-property property=autoCommit
value=false/
set
This may turn out to be an XML question rather than a struts
question, but here goes...
I have a data source defined in struts-config.xml, including
database URL. This has worked fine so far on my development machine,
but now I want to deploy my application to a different (production)
server
-Original Message-
From: Stephen Turner
To: [EMAIL PROTECTED]
Sent: 28-11-2001 20:44
Subject: Parameterizing Datasource URL
This may turn out to be an XML question rather than a struts
question, but here goes...
I have a data source defined in struts-config.xml, including
database URL. This has
I have no problem using Datasource in STRUT version
1.0, but when I upgrade STRUTS to nightly version, I
have a problem using datasource. Here how it happens
I first replace the XML parser and JAXP so that it can
support Namespace. Then I follow the instruction in
the Nighlt Release and I
, but it just did not work very well with frequently
dropping DB connections.
The connection it provides may be stale and invalid, but the URL, username,
and password are still good. So in my code, I simply took those attributes
and used them in my own datasource. I used Oracle's own pooled connection
Why is using Oracle's pooled connection datasource not ideal?
The GenericDataSource class can be handy, but it is expected that
developers will often use something else.
Personally, I use Poolman by CodeStudio.
I'd say the best approach is to have a helper class that returns the
connection
)
-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-config.xml:
data-sources
data-source
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 must
would like to know how to define datasource in struts... i tried
using the example given with struts... but i must be missing something to be
configured.. i configured the struts-config.xml file... for defining the
datasource... but it gives me ActionMapping errors...
take care everyone
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
the datasource in struts?
I can show you an example of what i'm using (MySQL):
In struts-config.xml:
data-sources
data-source
set-property property=autoCommit
value=false/
set-property property=description
value=MySQL/
set-property
On Tue, 21 Aug 2001, Richard William Lake wrote:
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
property=user
value=furnnet/
set-property property=url
value=jdbc:oracle:thin:@localhost:1521:furnnet/
/data-source
/data-sources
in java code:
fnDataSource =
(DataSource)(getServlet().getServletContext
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
ActionForward perform(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
Connection connection = null;
DataSource dataSource = null;
Statement
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
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);
...
%
Am I right?
Regards
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
201 - 300 of 335 matches
Mail list logo