Author Login
Post Reply
user Digest 8 Dec 2009 06:27:25 -0000 Issue 8953
Topics (messages 204107 through 204124):
Re: RequiredFieldValidator and error message from property file via key
204107 by: nguyenlinh
204108 by: nguyenlinh
Re: Struts HTML taglib vs. Standard HTML tags
204109 by: Dan Vargas
204111 by: Dan Vargas
[s2] design problem
204110 by: Tudor Andrei Raneti
204112 by: Wes Wannemacher
<param>-Tag in <action>-Tag:differences in 2.1.2 and >= 2.1.6
204113 by: Hans Solo
204114 by: Musachy Barroso
Mapping request to action object without actually defining action
204115 by: RafaÅ KrupiÅski
Re: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions
204116 by: Ignacio de Córdoba
EJb 3.1 (dependency injection) and Struts2 actions ¿CDI/Weld needed?
204117 by: Ignacio de Córdoba
Re: EJb 3.1 (dependency injection) and Struts2 actions ¿CDI/Weld needed?
204118 by: Wes Wannemacher
SQL ExcuteQuery
204119 by: Nguyen Xuan Son
204120 by: Sushim Saini
204121 by: Nguyen Xuan Son
204122 by: Avlesh Singh
204123 by: Nguyen Xuan Son
204124 by: Sushim Saini
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_204107.ezm (zipped)
I found the @ConversionErrorFieldValidator and it works almost the way I
wanted.
Now I get my error message but I also get the default struts error message
which is: Invalid field value for field "<field-name>".
Is there any "simple" way I can get rid of the default message from struts?
Thanks
nguyenlinh wrote:
>
> Hello,
> I have the same problem. So what kind of validator should I use if I have
> a field of type int and I want to make sure the user typed a number?
> Thanks,
> Linh
>
>
> Greg Lindholm-2 wrote:
>>
>> You may have a different problem then you think;
>>
>> The @RequiredFieldValidator does not make any sense on a int
>> (primitive) field as an int cannot be null. The validation interceptor
>> checks the values on the fields after params interceptor sets the
>> fields. The RequiredFieldValidator checks if the field is null which
>> will never be the case for a primitive field.
>>
>>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204108.ezm (zipped)
I found the solution now.
Just override invalid.fieldvalue.<field-name> in your properties file.
for example:
invalid.fieldvalue.aField=Ivalid value for "aField".
Thanks a lot, your answer got me on the right track.
Greg Lindholm-2 wrote:
>
> You may have a different problem then you think;
>
> The @RequiredFieldValidator does not make any sense on a int
> (primitive) field as an int cannot be null. The validation interceptor
> checks the values on the fields after params interceptor sets the
> fields. The RequiredFieldValidator checks if the field is null which
> will never be the case for a primitive field.
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204109.ezm (zipped)One of the most confusing things about it is that I can insert just one
<html:text> tag, for instance, into the fully functional(as far as being
rendered correctly) page, and then it just fails to render any of my jsp
page, not just the text area defined by the struts tag.
On Sun, Dec 6, 2009 at 3:54 AM, davargas123 <davargas123@(protected):
>
> I did check those to see if they had anything to do with it, but those
> aren't
> the problem. I literally copied them straight from another page in the same
> web app that I'm adding my page to. The page I'm doing is part of a larger
> web app that already has a number of jsp pages which include struts tags
> and
> work perfectly fine, but when I use the tags I totally lose all of the
> rendering. It's very odd, and I don't understand how I'm running into this
> problem based on what I've been reading about how to make your jsp pages
> and
> use strugs tags.
>
>
>
> Paul Benedict-2 wrote:
> >
> > Did you check your server logs? I bet the problem is the taglib uri.
> >
> > See the TLD URIs section:
> > http://wiki.apache.org/struts/StrutsUpgradeNotes12to13
> >
> > Paul
> >
> > On 12/4/2009 1:41 PM, davargas123 wrote:
> >>
> >> When I change the standard HTML tags of my .jsp page into the Struts
> >> tags,
> >> the page loads up completely blank, aside from what is loaded by the
> >> tiles-def. What could be causing this? I'm thinking that's why my page
> >> doesn't submit data to the actionform, but I don't see why it wouldn't
> be
> >> rendering the struts tags at all. For instance, if I even add ONE struts
> >> tag
> >> in the middle of my working code that isn't the html:form tag, the
> entire
> >> jsp page will not be rendered at all. It's driving me nuts, I've been
> >> working on figuring this out for far too long and would greatly
> >> appreciate
> >> some input.
> >>
> >>
> >> ---------------------------JSP---------------------------------------
> >> <%@(protected)"%>
> >> <%@(protected)"%>
> >> <%@(protected)
> >> import="com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction"
> >> %>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Struts-HTML-taglib-vs.-Standard-HTML-tags-tp26636386p26663145.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_204111.ezm (zipped)Dec 7, 2009 8:14:39 AM
com.thomson.west.pubrec.optout.ui.servlet.FindRequestResetAction execute
FINE: enter
Dec 7, 2009 8:14:44 AM
com.thomson.west.pubrec.optout.ui.servlet.SSNLookupResetAction execute
FINE: enter
Dec 7, 2009 8:14:50 AM com.thomson.west.pubrec.optout.sys.PrivacyEncryptor
initialize
SEVERE: euid is: 73B1BE33AB1853D6874AAF0A5A567DA8
Dec 7, 2009 8:14:50 AM com.thomson.west.pubrec.optout.sys.PrivacyEncryptor
initialize
SEVERE: epwd is: C2131A05B24DC7B9920DB3D8243A6849
This is what I get from the from the server log when I try submitting my
form. I don't understand the euid or epwd parts, other than that they are
erroneous.
On Sun, Dec 6, 2009 at 10:38 PM, Dan Vargas <davargas123@(protected):
> One of the most confusing things about it is that I can insert just one
> <html:text> tag, for instance, into the fully functional(as far as being
> rendered correctly) page, and then it just fails to render any of my jsp
> page, not just the text area defined by the struts tag.
>
>
> On Sun, Dec 6, 2009 at 3:54 AM, davargas123 <davargas123@(protected):
>
>>
>> I did check those to see if they had anything to do with it, but those
>> aren't
>> the problem. I literally copied them straight from another page in the
>> same
>> web app that I'm adding my page to. The page I'm doing is part of a larger
>> web app that already has a number of jsp pages which include struts tags
>> and
>> work perfectly fine, but when I use the tags I totally lose all of the
>> rendering. It's very odd, and I don't understand how I'm running into this
>> problem based on what I've been reading about how to make your jsp pages
>> and
>> use strugs tags.
>>
>>
>>
>> Paul Benedict-2 wrote:
>> >
>> > Did you check your server logs? I bet the problem is the taglib uri.
>> >
>> > See the TLD URIs section:
>> > http://wiki.apache.org/struts/StrutsUpgradeNotes12to13
>> >
>> > Paul
>> >
>> > On 12/4/2009 1:41 PM, davargas123 wrote:
>> >>
>> >> When I change the standard HTML tags of my .jsp page into the Struts
>> >> tags,
>> >> the page loads up completely blank, aside from what is loaded by the
>> >> tiles-def. What could be causing this? I'm thinking that's why my page
>> >> doesn't submit data to the actionform, but I don't see why it wouldn't
>> be
>> >> rendering the struts tags at all. For instance, if I even add ONE
>> struts
>> >> tag
>> >> in the middle of my working code that isn't the html:form tag, the
>> entire
>> >> jsp page will not be rendered at all. It's driving me nuts, I've been
>> >> working on figuring this out for far too long and would greatly
>> >> appreciate
>> >> some input.
>> >>
>> >>
>> >> ---------------------------JSP---------------------------------------
>> >> <%@(protected)"%>
>> >> <%@(protected)"%>
>> >> <%@(protected)
>> >> import="com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction"
>> >> %>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@(protected)
>> > For additional commands, e-mail: user-help@(protected)
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Struts-HTML-taglib-vs.-Standard-HTML-tags-tp26636386p26663145.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment:
user_204110.ezm (zipped)i load up dataParams.jsp from main.jsp:
[code] <c:when test="${param.dataParams == 'show' and param.data == null}">
<s:action name="dataParams_input" executeResult="true"></s:action></c:when> [/code]
i map it in struts.xml:
[code] <action name="dataParams_*" method="{1}" class="loto.action.DataParams">
<result type="redirectAction">/jsp/main.jsp</result>
<result name="input">/jsp/dataParams.jsp</result>
</action> [/code]
and set up a DataParams-validator.xml.
The problem starts when i submit dataParams.jsp 's form:
[code] <form action="dataParams" method="get"> [/code]
because it's supposed to validate while beeing loaded by main.jsp, but it displays alone not included in main.jsp when it displays errors.
The key to this problem is what should i write in <form action="????????????" to make this work the way i aim?
Further thoughts:
If i dataParams action doesn't get called when dataParams submits, the struts 2 xml validation doesn't fire.
dataParams.jsp is supposed to be always included in main.jsp though, showing errors or not,
but if i call main action, the struts 2 xml validation is always bypassed by the input action.
dataParams bypasses validation the first time because it doesn't need to validate when first shown (like in HelloWorld), should i validate from start and live with it?
Maybe action chaining would do it? I don't know...

Attachment:
user_204112.ezm (zipped)On Mon, Dec 7, 2009 at 3:03 AM, Tudor Andrei Raneti <w0lfshad3@(protected):
> i load up dataParams.jsp from main.jsp:
> [code] <c:when test="${param.dataParams == 'show' and param.data == null}">
> <s:action name="dataParams_input" executeResult="true"></s:action></c:when> [/code]
> i map it in struts.xml:
> [code] <action name="dataParams_*" method="{1}" class="loto.action.DataParams">
> <result type="redirectAction">/jsp/main.jsp</result>
> <result name="input">/jsp/dataParams.jsp</result>
> </action> [/code]
> and set up a DataParams-validator.xml.
> The problem starts when i submit dataParams.jsp 's form:
> [code] <form action="dataParams" method="get"> [/code]
> because it's supposed to validate while beeing loaded by main.jsp, but it displays alone not included in main.jsp when it displays errors.
This is by design (sort of), your "input" result dispatches to
/jsp/dataParams.jsp directly. It works on the first request because
you are using executeResult="true" in your s:action tag... But, if you
want input to go to main.jsp, then dispatch there on input... The
trouble you will then have is that it will create an infinite loop...
My suggestion is that you redesign your pages and flow so that it does
not depend on the s:action tag.
> The key to this problem is what should i write in <form action="????????????" to make this work the way i aim?
As I mention above, you are going to run into trouble no matter how
you try to work this out... Try to avoid the s:action tag.
>
> Further thoughts:
> If i dataParams action doesn't get called when dataParams submits, the struts 2 xml validation doesn't fire.
> dataParams.jsp is supposed to be always included in main.jsp though, showing errors or not,
> but if i call main action, the struts 2 xml validation is always bypassed by the input action.
> dataParams bypasses validation the first time because it doesn't need to validate when first shown (like in HelloWorld), should i validate from start and live with it?
> Maybe action chaining would do it? I don't know...
>
I hate to say it, but you might want to spend some more times looking
through examples or get a copy of Struts 2 In Practice from Manning
Publications or Apache Struts 2 Web Application Development by Dave
Newton.
-Wes
--
Wes Wannemacher
Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

Attachment:
user_204113.ezm (zipped)Hi,
I’m using the <param>-Tag in an <action>-Tag:
<action name="manageUserAttributes_*" method="{1}"
class="springManagedUserAttributesAction">
<param name="menu">access/users</param>
<param name="actionMapping">manageUserAttributes</param>
<result name="list">/jsp/access/users/attributes/list.jsp</result>
</action>
The interceptor-stack is the defaultStack.
I’ve also defined getter/setter for these parameters (menu/actionMapping).
Now on some calls, I’d like to overwrite e.g. the menu-parameter in the action.
This works for struts version 2.1.2.
But if I migrate to version 2.1.6 or 2.1.8.1, it is no longer possible
for me to overwrite these parameters!
The setter of the parameter is called several times and ends always
with setting the value that is given in the struts-mapping.
So it is not possible to set the value of the parameter explicit in
the action and read it in the result.
Example:
call: manageUserAttributes_list
method in the action:
public String list() {
setMenu(null);
user = userService.getUser(user.getId());
return RESULT_LIST;
}
If I process the menu-variable in the resulting jsp, the value is access/users.
Does someone know about this behaviour?
Am I doing something wrong or is it no longer possible to change these
parameters in actions?
Thank you
Tim

Attachment:
user_204114.ezm (zipped)Unfortunately this is a bug/enhancement dependent on your point of
view (what created this problem fixed other bugs). The way to get it
to work like you want is to add a "merge" param set to "false" in the
"staticParams" interceptor.
For reference:
https://issues.apache.org/struts/browse/WW-2970
http://jira.opensymphony.com/browse/XW-709
This should have not happened, but we just heard about it, so it is
kind of late :)
musachy
On Mon, Dec 7, 2009 at 4:21 AM, Hans Solo <hans.solo21@(protected):
> Hi,
>
> I’m using the <param>-Tag in an <action>-Tag:
>
> <action name="manageUserAttributes_*" method="{1}"
> class="springManagedUserAttributesAction">
>
> <param name="menu">access/users</param>
>
> <param name="actionMapping">manageUserAttributes</param>
>
> <result name="list">/jsp/access/users/attributes/list.jsp</result>
>
> </action>
>
>
> The interceptor-stack is the defaultStack.
>
> I’ve also defined getter/setter for these parameters (menu/actionMapping).
>
> Now on some calls, I’d like to overwrite e.g. the menu-parameter in the action.
>
> This works for struts version 2.1.2.
>
> But if I migrate to version 2.1.6 or 2.1.8.1, it is no longer possible
> for me to overwrite these parameters!
>
> The setter of the parameter is called several times and ends always
> with setting the value that is given in the struts-mapping.
>
> So it is not possible to set the value of the parameter explicit in
> the action and read it in the result.
>
>
> Example:
>
> call: manageUserAttributes_list
>
> method in the action:
>
> public String list() {
>
> setMenu(null);
>
> user = userService.getUser(user.getId());
>
> return RESULT_LIST;
>
> }
>
> If I process the menu-variable in the resulting jsp, the value is access/users.
>
> Does someone know about this behaviour?
>
> Am I doing something wrong or is it no longer possible to change these
> parameters in actions?
>
>
> Thank you
>
> Tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_204115.ezm (zipped)Hi, everybody!
I want to write a portlet that would take input from another portlet
(struts2-portlet) and return pdf document.
Binary data is available only with jsr286 portlet 2.0 and
struts2-portlet2 is experimental in sandbox.
All I need is to is to map HttpRequest object to properties of an
action object, I don't need the rest of struts framework in this
particular problem.
Could anyone tell me how to do that?

Attachment:
user_204116.ezm (zipped)
Which appserver are you using?
I use JBoss for struts2 plugin. I hace to modifyit as it didn't support
JBoss 5 naming conventions (at least for me) and it only looked for
annotations in current class, so if you injected a Session Bean in a
super.execute() method in a parent class, it was not looked up.
Anyway, I am considering moving to EJB 3.1 and hope I can find a new way of
injecting new EJBs...
Fernandes Celinio wrote:
>
> Hi,
> I know that it is not possible to inject EJB in Struts 2 actions.
> The following annotation would not work :
> @EJB
> MyBeanLocal mybean;
>
> But how come ? Since a Struts action is a servlet and injection works in
> a servlet, injection should work.
>
> Thanks for enlightening me.
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204117.ezm (zipped)
Hi there,
I'd like to know if there is a recommended approach to deal with dependency
injection on new EJB 3.1 EJBs.
I am using now a modified version of JBoss Struts2 plugin with works great
but it really does nothing more than regular JNDI lookups on every action
request call.
I wonder if there is a new approach to getting EJB 3.1 session beans
(stateless to be precise) which is what mostly I have to deal with. I've
seen in the DEV forum that a plugin for CDI/Weld is coming (hopefully soon).
Should we have to wait for this plugin or there is a simple approach to just
inject new EJBs in struts2 actions? (@(protected)... ? :-) )
Of course, I have already tested new GlassFish v3, even though I'll probably
be using new JBoss 6 (I have already tested it with my previous EJB3 Struts2
projects and works ok, so I'd like to start my new projects directly with
EJB 3.1)
Thanks for any directions.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204118.ezm (zipped)On Mon, Dec 7, 2009 at 4:02 PM, Ignacio de Córdoba <icordoba@(protected):
>
> Hi there,
> I'd like to know if there is a recommended approach to deal with dependency
> injection on new EJB 3.1 EJBs.
> I am using now a modified version of JBoss Struts2 plugin with works great
> but it really does nothing more than regular JNDI lookups on every action
> request call.
Unfortunately, this is the best mechanism that we have, currently. The
thing about the JEE5 spec is that it specified annotations for
dependency injection, but did not standardize the mechanism for
retrieving the would-be-injected objects (other than JNDI). Struts
uses various different mechanisms for instantiating classes, it has
it's own internal DI, some reflections, and even delegates to other
mechanisms like Spring or Guice. But, the problem is that struts
creates its own objects and it is the Application Server that does the
EJB injection.
> I wonder if there is a new approach to getting EJB 3.1 session beans
> (stateless to be precise) which is what mostly I have to deal with. I've
> seen in the DEV forum that a plugin for CDI/Weld is coming (hopefully soon).
This will most likely be the preferred mechanism in the future. But,
in the same thread you probably saw that this feature is a part of
JEE6.
> Should we have to wait for this plugin or there is a simple approach to just
> inject new EJBs in struts2 actions? (@(protected)... ? :-) )
At this point, the only "simple approach" is JNDI lookups. The plugins
that do this currently are as good as you are going to get for now.
Since it is looking like we are going to move our internal DI toward
the specification, you will probably have better support for JEE/EJB
DI in the future.
> Of course, I have already tested new GlassFish v3, even though I'll probably
> be using new JBoss 6 (I have already tested it with my previous EJB3 Struts2
> projects and works ok, so I'd like to start my new projects directly with
> EJB 3.1)
>
--
Wes Wannemacher
Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

Attachment:
user_204119.ezm (zipped)dear all
I've written
Connection conn = null;
PreparedStatement pstmtname = null;
pstmtname = conn.prepareStatement(sql);
sql = "UPDATE tbl_content_admin_accounts SET CA_PASSWORD = ? WHERE ROW_ID =
" + UserID;
pstmtname.setString(1, "123456");
pstmtname.executeQuery();
there is no error appear but nothing is changed in the database
do you have any suggestion?
thank you very much
--
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son
Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax : 81-(0)90-3976 2246
Email : nr0003xx@(protected)
Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
=======================================================================

Attachment:
user_204120.ezm (zipped)hi Nguyen Xuan Son
use
pstmtname.executeQuery() instead of pstmtname.executeQuery();
On Tue, Dec 8, 2009 at 11:29, Nguyen Xuan Son <yamacom@(protected):
> dear all
> I've written
> Connection conn = null;
> PreparedStatement pstmtname = null;
> pstmtname = conn.prepareStatement(sql);
> sql = "UPDATE tbl_content_admin_accounts SET CA_PASSWORD = ? WHERE ROW_ID
> =
> " + UserID;
> pstmtname.setString(1, "123456");
> pstmtname.executeQuery();
>
> there is no error appear but nothing is changed in the database
> do you have any suggestion?
> thank you very much
>
> --
> =======================================================================
> Ritsumeikan University, Asia JinZai Project
> Master of Information Science
> Nguyen Xuan Son
>
> Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> ShiteiHaimu
> Rien, Room 103
> Tel/Fax : 81-(0)90-3976 2246
> Email : nr0003xx@(protected)
> Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
> =======================================================================
>
--
--
Sushim Saini

Attachment:
user_204121.ezm (zipped)sorry saini but i dont see any different from your answer
thank you
2009/12/8 Sushim Saini <sushimsaini@(protected)>
> hi Nguyen Xuan Son
> use
> pstmtname.executeQuery() instead of pstmtname.executeQuery();
>
> On Tue, Dec 8, 2009 at 11:29, Nguyen Xuan Son <yamacom@(protected):
>
> > dear all
> > I've written
> > Connection conn = null;
> > PreparedStatement pstmtname = null;
> > pstmtname = conn.prepareStatement(sql);
> > sql = "UPDATE tbl_content_admin_accounts SET CA_PASSWORD = ? WHERE
> ROW_ID
> > =
> > " + UserID;
> > pstmtname.setString(1, "123456");
> > pstmtname.executeQuery();
> >
> > there is no error appear but nothing is changed in the database
> > do you have any suggestion?
> > thank you very much
> >
> > --
> > =======================================================================
> > Ritsumeikan University, Asia JinZai Project
> > Master of Information Science
> > Nguyen Xuan Son
> >
> > Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> > ShiteiHaimu
> > Rien, Room 103
> > Tel/Fax : 81-(0)90-3976 2246
> > Email : nr0003xx@(protected)
> > Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
> > =======================================================================
> >
>
>
>
> --
> --
> Sushim Saini
>
--
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son
Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax : 81-(0)90-3976 2246
Email : nr0003xx@(protected)
Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
=======================================================================

Attachment:
user_204122.ezm (zipped)Use #executeUpdate instead.
Cheers
Avlesh
On Tue, Dec 8, 2009 at 11:37 AM, Nguyen Xuan Son <yamacom@(protected):
> sorry saini but i dont see any different from your answer
> thank you
>
> 2009/12/8 Sushim Saini <sushimsaini@(protected)>
>
> > hi Nguyen Xuan Son
> > use
> > pstmtname.executeQuery() instead of pstmtname.executeQuery();
> >
> > On Tue, Dec 8, 2009 at 11:29, Nguyen Xuan Son <yamacom@(protected):
> >
> > > dear all
> > > I've written
> > > Connection conn = null;
> > > PreparedStatement pstmtname = null;
> > > pstmtname = conn.prepareStatement(sql);
> > > sql = "UPDATE tbl_content_admin_accounts SET CA_PASSWORD = ? WHERE
> > ROW_ID
> > > =
> > > " + UserID;
> > > pstmtname.setString(1, "123456");
> > > pstmtname.executeQuery();
> > >
> > > there is no error appear but nothing is changed in the database
> > > do you have any suggestion?
> > > thank you very much
> > >
> > > --
> > > =======================================================================
> > > Ritsumeikan University, Asia JinZai Project
> > > Master of Information Science
> > > Nguyen Xuan Son
> > >
> > > Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> > > ShiteiHaimu
> > > Rien, Room 103
> > > Tel/Fax : 81-(0)90-3976 2246
> > > Email : nr0003xx@(protected)
> > > Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
> > > =======================================================================
> > >
> >
> >
> >
> > --
> > --
> > Sushim Saini
> >
>
>
>
> --
> =======================================================================
> Ritsumeikan University, Asia JinZai Project
> Master of Information Science
> Nguyen Xuan Son
>
> Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> ShiteiHaimu
> Rien, Room 103
> Tel/Fax : 81-(0)90-3976 2246
> Email : nr0003xx@(protected)
> Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
> =======================================================================
>

Attachment:
user_204123.ezm (zipped)dear singgh
I've tried to user the excuteUpdate but the errors appear
detail is
java.sql.SQLException: Can not issue executeUpdate() for SELECTs
at
com.mysql.jdbc.SQLError.createSQLException (
SQLError.java:1055)
at
com.mysql.jdbc.SQLError.createSQLException (
SQLError.java:956)
at
com.mysql.jdbc.SQLError.createSQLException (
SQLError.java:926)
at
com.mysql.jdbc.PreparedStatement.executeUpdate (
PreparedStatement.java:2320)
at
com.mysql.jdbc.PreparedStatement.executeUpdate (
PreparedStatement.java:2280)
at
com.mysql.jdbc.PreparedStatement.executeUpdate (
PreparedStatement.java:2265)
do you have any suggestion?
thanks you very much
2009/12/8 Avlesh Singh <avlesh@(protected)>
> Use #executeUpdate instead.
>
> Cheers
> Avlesh
>
> On Tue, Dec 8, 2009 at 11:37 AM, Nguyen Xuan Son <yamacom@(protected)>
> wrote:
>
> > sorry saini but i dont see any different from your answer
> > thank you
> >
> > 2009/12/8 Sushim Saini <sushimsaini@(protected)>
> >
> > > hi Nguyen Xuan Son
> > > use
> > > pstmtname.executeQuery() instead of pstmtname.executeQuery();
> > >
> > > On Tue, Dec 8, 2009 at 11:29, Nguyen Xuan Son <yamacom@(protected)>
> wrote:
> > >
> > > > dear all
> > > > I've written
> > > > Connection conn = null;
> > > > PreparedStatement pstmtname = null;
> > > > pstmtname = conn.prepareStatement(sql);
> > > > sql = "UPDATE tbl_content_admin_accounts SET CA_PASSWORD = ? WHERE
> > > ROW_ID
> > > > =
> > > > " + UserID;
> > > > pstmtname.setString(1, "123456");
> > > > pstmtname.executeQuery();
> > > >
> > > > there is no error appear but nothing is changed in the database
> > > > do you have any suggestion?
> > > > thank you very much
> > > >
> > > > --
> > > >
> =======================================================================
> > > > Ritsumeikan University, Asia JinZai Project
> > > > Master of Information Science
> > > > Nguyen Xuan Son
> > > >
> > > > Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> > > > ShiteiHaimu
> > > > Rien, Room 103
> > > > Tel/Fax : 81-(0)90-3976 2246
> > > > Email : nr0003xx@(protected)
> > > > Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
> > > >
> =======================================================================
> > > >
> > >
> > >
> > >
> > > --
> > > --
> > > Sushim Saini
> > >
> >
> >
> >
> > --
> > =======================================================================
> > Ritsumeikan University, Asia JinZai Project
> > Master of Information Science
> > Nguyen Xuan Son
> >
> > Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> > ShiteiHaimu
> > Rien, Room 103
> > Tel/Fax : 81-(0)90-3976 2246
> > Email : nr0003xx@(protected)
> > Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
> > =======================================================================
> >
>
--
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son
Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax : 81-(0)90-3976 2246
Email : nr0003xx@(protected)
Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
=======================================================================

Attachment:
user_204124.ezm (zipped)sorry use executeUpdate
On Tue, Dec 8, 2009 at 11:53, Nguyen Xuan Son <yamacom@(protected):
> dear singgh
> I've tried to user the excuteUpdate but the errors appear
> detail is
>
>
java.sql.SQLException: Can not issue executeUpdate() for SELECTs
> at
com.mysql.jdbc.SQLError.createSQLException (
SQLError.java:1055)
> at
com.mysql.jdbc.SQLError.createSQLException (
SQLError.java:956)
> at
com.mysql.jdbc.SQLError.createSQLException (
SQLError.java:926)
> at
>
com.mysql.jdbc.PreparedStatement.executeUpdate (
PreparedStatement.java:2320)
> at
>
com.mysql.jdbc.PreparedStatement.executeUpdate (
PreparedStatement.java:2280)
> at
>
com.mysql.jdbc.PreparedStatement.executeUpdate (
PreparedStatement.java:2265)
>
> do you have any suggestion?
>
> thanks you very much
>
>
> 2009/12/8 Avlesh Singh <avlesh@(protected)>
>
> > Use #executeUpdate instead.
> >
> > Cheers
> > Avlesh
> >
> > On Tue, Dec 8, 2009 at 11:37 AM, Nguyen Xuan Son <yamacom@(protected)>
> > wrote:
> >
> > > sorry saini but i dont see any different from your answer
> > > thank you
> > >
> > > 2009/12/8 Sushim Saini <sushimsaini@(protected)>
> > >
> > > > hi Nguyen Xuan Son
> > > > use
> > > > pstmtname.executeQuery() instead of pstmtname.executeQuery();
> > > >
> > > > On Tue, Dec 8, 2009 at 11:29, Nguyen Xuan Son <yamacom@(protected)>
> > wrote:
> > > >
> > > > > dear all
> > > > > I've written
> > > > > Connection conn = null;
> > > > > PreparedStatement pstmtname = null;
> > > > > pstmtname = conn.prepareStatement(sql);
> > > > > sql = "UPDATE tbl_content_admin_accounts SET CA_PASSWORD = ? WHERE
> > > > ROW_ID
> > > > > =
> > > > > " + UserID;
> > > > > pstmtname.setString(1, "123456");
> > > > > pstmtname.executeQuery();
> > > > >
> > > > > there is no error appear but nothing is changed in the database
> > > > > do you have any suggestion?
> > > > > thank you very much
> > > > >
> > > > > --
> > > > >
> > =======================================================================
> > > > > Ritsumeikan University, Asia JinZai Project
> > > > > Master of Information Science
> > > > > Nguyen Xuan Son
> > > > >
> > > > > Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> > > > > ShiteiHaimu
> > > > > Rien, Room 103
> > > > > Tel/Fax : 81-(0)90-3976 2246
> > > > > Email : nr0003xx@(protected)
> > > > > Mobile : 81-(0)90-3976 2246 URL :
> http://www.ritsumei.jp
> > > > >
> > =======================================================================
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > --
> > > > Sushim Saini
> > > >
> > >
> > >
> > >
> > > --
> > > =======================================================================
> > > Ritsumeikan University, Asia JinZai Project
> > > Master of Information Science
> > > Nguyen Xuan Son
> > >
> > > Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> > > ShiteiHaimu
> > > Rien, Room 103
> > > Tel/Fax : 81-(0)90-3976 2246
> > > Email : nr0003xx@(protected)
> > > Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
> > > =======================================================================
> > >
> >
>
>
>
> --
> =======================================================================
> Ritsumeikan University, Asia JinZai Project
> Master of Information Science
> Nguyen Xuan Son
>
> Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> ShiteiHaimu
> Rien, Room 103
> Tel/Fax : 81-(0)90-3976 2246
> Email : nr0003xx@(protected)
> Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
> =======================================================================
>
--
--
Sushim Saini