Displaying Date value using ASP
Dear all,
I am currently trying to display the value in an Oracle date
field using ASP. However, I encountered the following error :
Microsoft OLE DB Provider for ODBC Drivers error '80020009'
Multiple-step OLE DB operation generated errors. Check each OLE
DB status value, if available. No work was done.
My code is as follow:
set abc= server.createobject("adodb.recordset")
abc.activeconnection = gDBConnectString
sqlstring = "select c_datetime from counter_tbl where c_variable
= 'counter1'"
abc.open sqlstring
response.write abc("c_datetime")
I have tried using to_Date to format the field but when I try to
display it, there will be the same errors again. The SQL
statement executes successfully in SQLPLUS.
Please help. Thanks!
Regards,
Dara.
Hi Colin,
I may be misinterpreting your question -- so I don't know how much this will help you, but the Oracle-to-java mapping for database table columns with the DATE datatype changed in the "ojdbc14.jar" driver (from the "classes12.zip" driver), from "java.sql.Timestamp" to "java.sql.Date".
However, since I saw no details in your post regarding your environment/platform, like I said before, this may not help you much!
In any case, the mappings (Oracle-to-java) are detailed in the Oracle documentation -- which is available from the Tahiti Web site (in case you didn't know). Have you checked the documentation?
Good Luck,
Avi.
Similar Messages
-
Display data vertically using sap script
Hi Developers,
Is there any way to display data vertically in a form using sap script?
thanx in advance,
binuHi Binu,
It is not possible to rotate text in SAPscript. The usual work-around, provided this is static text and not from a variable, is to scan an image of the text and include it as a graphic.
Regards,
Nick -
How to avoid displaying date,time using Enhancement point.
Hi friends,
i have to work on the standard report.
stadard report displays date,time ,reportname on the top of the page. my requirement is not to display date ,time,reportname.
they have used the following code,
WRITE text-001 TO m_line+d_offset(4). " Time
WRITE sy-timlo USING EDIT MASK '__:__:__' TO m_line+d_offset(08).
WRITE text-002 TO m_line+d_offset(05). " Date
WRITE sy-datlo DD/MM/YYYY TO m_line+d_offset(10).
BY using Enhancement point how to achieve my task.
kindly help mePost Author: jsanzone
CA Forum: WebIntelligence Reporting
basham,
You didn't mention which type of DBMS you are using (i.e. Oracle, MS SQL, MySQL, etc), but in a nutshell using MS SQL here is the principle. Your time that is recorded in the records is dependent upon a setting in your RDBMS. For instance, the RDBMS can use the machine time (which would most likely be local time), or it can use the machine time with an offset (to accomodate GMT, for instance). GMT is factored differently based upon your time zone (and time of year, i.e. DST or EST, etc). I'm on the east coast so right now my offset is GMT - 5, so if my time right now is 1457, then GMT is 1957. To get SQL to compute an offset you must take the number of hours to offset and divide by 24 (24 hours in a day) and add that to the record in the database. For instance, to get GMT right now I would use:
select cast(getdate()5/24. as char(12))rtrim(convert(char(12),getdate()5/24.,8))' GMT'
Hope this helps. If you're on Oracle, then the mathematical principles remain the same, just the formatting will be different. -
Need a maximum date value using group by
Create table student (dept number(10), dep_name varchar2(10),join_date date,years_attended number(10),end_date date);
insert into student values (1,'I',to_date('3/7/1917','MM/DD/YYYY'),4,to_date('8/26/1987','MM/DD/YYYY'));
insert into student values (1,'I',to_date('1/1/1900','MM/DD/YYYY'),4,to_date('8/26/1932','MM/DD/YYYY'));
insert into student values (1,'D',to_date('1/1/1920','MM/DD/YYYY'),5,to_date('8/26/1994','MM/DD/YYYY'));
insert into student values (1,'C',to_date('1/1/1920','MM/DD/YYYY'),6,to_date('8/26/1945','MM/DD/YYYY'));
insert into student values (2,'I',to_date('7/1/1900','MM/DD/YYYY'),3,to_date('8/26/1932','MM/DD/YYYY'));
insert into student values (2,'I',to_date('8/16/1916','MM/DD/YYYY'),9,to_date('8/26/1923','MM/DD/YYYY'));
insert into student values (2,'D',to_date('8/16/1916','MM/DD/YYYY'),10,to_date('8/26/1987','MM/DD/YYYY'));
insert into student values (3,'I',to_date('3/7/1917','MM/DD/YYYY'),4,to_date('8/26/1987','MM/DD/YYYY'));
insert into student values (3,'D',to_date('7/28/1920','MM/DD/YYYY'),6,to_date('8/26/1945','MM/DD/YYYY'));
insert into student values (3,'I',to_date('7/28/1920','MM/DD/YYYY'),8,to_date('8/26/1965','MM/DD/YYYY'));
insert into student values (4,'I',to_date('12/31/1924','MM/DD/YYYY'),2,to_date('8/26/1998','MM/DD/YYYY'));
insert into student values (4,'I',to_date('6/10/1929','MM/DD/YYYY'),1,to_date('8/26/1943','MM/DD/YYYY'));
insert into student values (4,'C',to_date('1/17/1927','MM/DD/YYYY'),4,to_date('8/26/1955','MM/DD/YYYY'));
insert into student values (4,'C',to_date('6/10/1929','MM/DD/YYYY'),30,to_date('8/26/1967','MM/DD/YYYY'));
insert into student values (5,'D',to_date('2/10/1931','MM/DD/YYYY'),2,to_date('8/26/1943','MM/DD/YYYY'));
insert into student values (5,'I',to_date('2/10/1931','MM/DD/YYYY'),24,to_date('8/26/1962','MM/DD/YYYY'));
commit;I need a maximum date value join_date for each department. If max(join_date) has two records for each dept then max(end_date) should be considered. I have used a below select query
select * from student where join_date in (select
max(join_date) from student group by dept);which gives me the following result
1 D 1/1/1920 5 8/26/1994
1 C 1/1/1920 6 8/26/1945
2 I 8/16/1916 9 8/26/1923
2 D 8/16/1916 10 8/26/1987
3 D 7/28/1920 6 8/26/1945
3 I 7/28/1920 8 8/26/1965
4 I 6/10/1929 1 8/26/1943
4 C 6/10/1929 30 8/26/1967
5 D 2/10/1931 2 8/26/1943
5 I 2/10/1931 24 8/26/1962But I am looking for the result which gives me only one maximum value for each dept column. First it should look for maximum value of join_date, if two records has same join_date then max(end_date) should be considered. The result should be sumthing like this
1 D 1/1/1920 5 8/26/1994
2 D 8/16/1916 10 8/26/1987
3 I 7/28/1920 8 8/26/1965
4 C 6/10/1929 30 8/26/1967
5 I 2/10/1931 24 8/26/1962Can you please tell me how to rewrite the select query to get the above results.
Edited by: user11872870 on Aug 2, 2011 5:29 PM
Edited by: user11872870 on Aug 2, 2011 5:36 PMHi,
That's called a Top-N Query , and here's one way to do it:
WITH got_r_num AS
SELECT student.*
, ROW_NUMBER () OVER ( PARTITION BY dept
ORDER BY join_date DESC
, end_date DESC
) AS r_num
FROM student
SELECT dept, dep_name, join_date, years_attended, end_date
FROM got_r_num
WHERE r_num = 1
ORDER BY dept
;Another way is similar to what you originally posted:
SELECT *
FROM student
WHERE (dept, join_date, end_date)
IN (
SELECT dept
, MAX (join_date)
, MAX (end_date) KEEP (DENSE_RANK LAST ORDER BY join_date)
FROM student
GROUP BY dept
);I suspect the first way (using ROW_NUMBER) will be faster.
Also, the ROW_NUMBER approach is guaranteed to return only 1 row per dept. Using the GROUP BY approach,if there is a tie on join_date and end_date, then it will return all contenders in that dept. Using ROW_NUMBER, it's easy to add as many tie-breaking expressions as you want, and, if there is still a tie, it will arbirarily pick one of the rows involved in the tie as #1.
Thanks for posting the CREATE TABLE and INSERT statments! That's very helpful.
Edited by: Frank Kulash on Aug 2, 2011 9:00 PM
Added GROUP BY alternative -
Is there any possible that pivot table can display date values in the data area like this?
I use Power Query to load data(including all the of data showed in the following table without accumulating) from database to the Excel Worksheet, and I want to build a pivot table like this.
But the data area of the pivot table can only accecpt and display numeric data. Is there any possible that such a display can be achieved?
Thanks.Hi,
Would you like to upload a sample file through OneDrive? I'd like to see the data source structure and test it.
Regards,
George Zhao
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
Finding variable data value using fms
hi experts
i want find variable field value by using fms.pls help me
exact scenerio is
i want fetch the value tax amount of respective tax code from the Define tax Amount distribution form.
eg.if suppose i tax code BED+VAT then i want get what is the calculated value of excise ,cess and and vat .i get the row tax amount.whwn i click tax amount filed i get tax amount distribution form from this form i want that particular valu
what is exactsql for thisHi Sachin,
No need to go FMS. Open any transcation screen. For eg., Open Sales Order, goto Form Setting -> Table Format. Please check the field column like "Tax Only".
Then open any SO, check it out this Link, u will get the full information and tax break etc...
Thanks
SAGAR -
How to insert data values using Poplist to both block items....
Hi,
I have created a poplist which should return a sequence(which is stored in a db table) and a description .
The sequence(stored in table) is of number datatype and the description is of varchar2.....
I have created the required record group as:
rg_id := Create_Group_From_Query('TEXNIKOS_GROUP', 'select eponymo , to_char(seq_code_ergazomenoy)
from ref_ergazomenos,ref_eidikothta
where ref_ergazomenos.code_eidikothtas_type_id=ref_eidikothta.seq_code_eidikothtas
order by 1');
status := Populate_Group( rg_id );
if (status = 0)
then
POPULATE_LIST('MOD2_KLISI_VLAVIS.TEXNIKOS_FNAME','TEXNIKOS_GROUP');
end if;The field 'MOD2_KLISI_VLAVIS.TEXNIKOS_FNAME' is the description i described above ... and whereas this block item is filled with the selected poplist... the sequence - the code of the db table- is not.....
Is it possible to do so.... ????
NOTE: i use Dev10g.
Many thanks,
SimonI have two block items:
seq_code_ergazomenoy: number datatype , db item , invisible
eponymo:varchar2 datatype , non db item , visible
How to fill these both block items using the written record group...?????
Now , only the "eponymo" block item is filled but not the required "seq_code_ergazomenoy"....
In other words.... is there any manner to do the column mapping of the two selected columns (in the dynamically created record group) to the two block items....????
Thanks,
Simon
Message was edited by:
sgalaxy -
List View still displays dates as numbers after 2.1 Hotfix
Hi
Just tried the List View component after installing Fix Pack 2.1 Hot Fix. I put a list view component on the canvas, selected 3 datesone for each header, changed the Appearance - Header to Date and then hit preview. The first header worksshows the dates but the other two headers show numbers, not dates.
The documentation shows that this was fixed, see below
ADAPT01260598 (List View displays
dates as numbers)
Description:
The header area of List View displays date values as numbers.
New Behavior:
This issue is resolved.No, I was just wondering since I have a second device on TMobile US and haven't gotten the update. I loaded this OS almost a month ago when it leaked on the Internet.
1. Please thank those who help you by clicking the "Like" button at the bottom of the post that helped you.
2. If your issue has been solved, please resolve it by marking the post "Solution?" which solved it for you! -
Display Variable Values in 7.0
There was an option in BW 3.x to display variable values using technical settings -> display -> variable values. I do not see this option in 7.0!? Showing the variable values is a great way to figure out whether or not a customer exit variables are working as expected. Could someone please help me with finding this option in the BEx analyzer? Points will be assigned for useful posts? Thanks for your time.
Dear Sameer,
As I understand from your question that you want to debug whether the customer exit variable logic is workinig fine or not. For that you can set a session breakpoint for the variable exit in CMOD. Now use the transaction rsrt to run the query. This will take you to the debug mode and here you can see the variable values and whether the logic is performing as expected or not.
Regards,
Prem. -
Dsiplay data values and data lables in a stacked column chart
Hi All
Is there a way to display data values and data labels in a stacked column chart. Mouse over or display of labels in legends wont help. It has to be in the chart .
Regards,
anshulHi Anshul,
You can display either data value or data label in a stacked column chart by checking the Data Label Displaying Mode option under Format Chart->Data Values.
You can also do the same by checking the same option under Format chart->Area Display->Data Values.
I dont think you would be able to display both in a column chart whereas you would be able to do it in a pie chart.
Hope this helps.
Regards
Sri Harsha -
Not able to display data in separate columns using Unicode encoding
Hi,
Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
Please let me know how to display data in different columns using Unicode encoding in Excel sheet.
This is an urgent need. Please help me out.Hi,
I have no problem with item :P15_EV_LCL this is having a value my probem here is i am using java script to display the value in different color based on the condtion case
eg:
select
case
TRUNC((
( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
),2)
= :P15_EV_LCL
then
span style="background-color:lightgreen"
|| TRUNC((
( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
),2) || '%' || /span
else
span style="background-color:yellow"
|| TRUNC(
( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
),2) || '%' || /span
end "Effort"
from actuals Z
If i dont use this <Span style="Background-color:color"> i am able to generate data in excel sheet if i use this color coding i am not able to get data in spread sheet.
Please suggest
Thanks
Sudhir
Edited by: Sudhir_N on Mar 23, 2009 10:00 PM -
Unable to display data no entry in the table without using Model clause
Hi,
I've an urgent requirement described below :
The previously posted Question has been answerted using Model Clause:
Is there any way out to solve it without using Model clause:
I've a table named as "sale" consisting of three columns : empno, sale_amt and sale_date.
(Please ref. The table script with data as given below)
Now if I execute the query :
"select trunc(sale_date) sale_date, sum(sale_amt) total_sale from sale group by trunc(sale_date) order by 1"
then it displays the data for the dates of which there is an entry in that table. But it does not display data for the
date of which there is no entry in that table.
If you run the Table script with data in your schema, then u'll see that there is no entry for 28th. Nov. 2009 in
sale table. Now the above query displays data for rest of the dates as its are in sale table except for 28th. Nov. 2009.
But I need its presence in the query output with a value of "sale_date" as "28th. Nov. 2009" and that of "total_sale" as
"0".
Is there any means to get the result as I require?
Please help ASAP.
Thanks in advance.
Create table script with data:
CREATE TABLE SALE
EMPNO NUMBER,
SALE_AMT NUMBER,
SALE_DATE DATE
SET DEFINE OFF;
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE('12/01/2009 10:20:10', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE('11/30/2009 10:21:04', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE('11/29/2009 10:21:05', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE('11/26/2009 10:21:06', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE('11/25/2009 10:21:07', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(200, 5000, TO_DATE('11/27/2009 10:23:06', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(200, 4000, TO_DATE('11/29/2009 10:23:08', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(200, 3000, TO_DATE('11/24/2009 10:23:09', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(200, 2000, TO_DATE('11/30/2009 10:23:10', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 7000, TO_DATE('11/24/2009 10:24:19', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 5000, TO_DATE('11/25/2009 10:24:20', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 3000, TO_DATE('11/27/2009 10:24:21', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 2000, TO_DATE('11/29/2009 10:24:22', 'MM/DD/YYYY HH24:MI:SS'));
Insert into SALE
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 1000, TO_DATE('11/30/2009 10:24:22', 'MM/DD/YYYY HH24:MI:SS'));
COMMIT;
Any help will be needful for me
Regards,select sale_date,sum(sale_amt) total_sale
from
select empno,0 sale_amt,(sale_date + ao.rn) sale_date
from
select empno,sale_amt,sale_date ,(t.nxt_dt - t.sale_date) diff
from
select empno
,sale_amt,trunc(sale_date) sale_date
,trunc(nvl(lead(sale_date) over (partition by 1 order by sale_date),sale_date)) nxt_dt
from sale
) t
where (t.nxt_dt - t.sale_date) >1
) rec,(select rownum rn from user_objects where rownum<=200) ao
where ao.rn <=(rec.diff-1)
union all
select empno,sale_amt,trunc(sale_date) sale_date
from sale
group by sale_date
order by 1;
~~~~Guess this will serve the purpose...
Cheers Arpan -
Display data on ADF table using a VO binded to a message.properties file
Hi,
I want to display data in a JSPX page using ADF table which is based on a ViewObject. The attributes of the ViewObject should get it's value from a abc.properties file(static file).How can i achieve this.
thanks in advance.
regards,
Himanshu.Hi Himanshu,
When you create a VO based on static values, all of the records from your VO are generated into the MessageBundel.properties file like this
devguide.entity.ViewObj.SL_0_0=1
devguide.entity.ViewObj.SL_0_1=<val1>
devguide.entity.ViewObj.SL_0_2=<val2>
devguide.entity.ViewObj.SL_1_0=2
devguide.entity.ViewObj.SL_1_1=<val1>
devguide.entity.ViewObj.SL_1_2=<val2>
You could add more lines to the properties files maintaining the same pattern. Also noticed that you can read all the values from a CSV file as well.
The last resource is to programmatically read the file and start creating new rows on the VO, which won't use any of the declarative tools for VOs.
-Juan Camilo. -
ALV Report how to display from and to date values in the header.
I develoeped alv report . i want to display selection screen from and to date values in top of page...
any sample code pls guide me..You have to do many things...
first find the selection details using the FM.
RS_REFRESH_FROM_SELECTOPTIONS
use the Blog to Align/populate the Header from the selection table
/people/community.user/blog/2007/05/07/alignment-of-data-in-top-of-page-in-alv-grid -
Re: [SunONE-JATO] Re: Using an object to store and display data
Personally, I think there is little or no value to creating a "domain"
object that itself relies on a JATO QueryModel internally, but hides that
fact and requires use of BeanAdapterModel.
It would be more appropriate (and much less work, and more scalable) to just
derive a QueryModel subclass and add the domain-specific behavior to the
model. In other words, what's the point of creating an object that hides
JATO inside it when you're running in JATO to begin with? Now if the domain
object were doing plain JDBC, and thus trying to be JATO independent, that
would be different. However, you could still implement the Model interface
on the object (or use BeanAdapterModel) to integrate it seamlessly with the
View tier.
Todd
----- Original Message -----
From: "grschroeder" <grschroeder@y...>
Sent: Wednesday, July 31, 2002 12:00 PM
Subject: [SunONE-JATO] Re: Using an object to store and display data
Craig,
I think it all finally makes sense. First, your assumption is
correct regarding the process flow. The ViewBean will interact with
a custom Javabean which will then in turn interact with a SQL Model
to access the database. So now let me make sure I understand what I
need to do. Basically the custom Javabean will have a method to get
the SQLModel. I would then invoke the setValue method on the
SQLModel and call the appropriate execute method( e.g.,
executeUpdate, etc. ) just like I would do from a ViewBean. Does
this sound correct?
Thanks,
Greg
--- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
wrote:
Greg,
see below...
grschroeder wrote:
Thanks for the help Craig. I looked at the sample code that makes
use of the BeanAdapterModel. Basically it looks like it allows a
view to interact with a bean the same way it would interact with
any
other model. That part I think I understand.
This is correct.
The part I'm a little
unclear on still is how to interface this BeanAdapterModel( which
is
a very basic model ) that I now have with a query model toactually
interact with the database.
Not sure what you mean by "interface this BeanAdapterModel ... witha
query model". Does this mean that you have a ViewBean the interactswith
a custom JavaBean via the BeanAdpterModel wrapper, and from the
JavaBean you are interacting with the SQL Model?
So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
SQL Model > RDBMS
That's what I am reading anyway. Please explain this to me.
Would I need to make direct JDBC calls
from my custom model instead of letting JATO dynamically create
the
calls for me?
If my assumptions above are correct, then the custom JavaBean cansimply
use the SQL Model in exactly the same manner as the ViewBean,otherwise,
if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
which is fine, if you do it "right" (connection pooling, result set
handling, etc.).
Thanks,
Greg
--- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
wrote:
I think the best approach would be to treat your Domain Objects
(DO) as
the Database (the enterprise tier) from JATO's perspective. You
could
create custom models that interface with our DO's and then the
JATO
Views could easily bind to the custom DO models just like anyother
model. This should eliminate the need for pushing data/objectsfrom
>
view
to model to database.
There is a JATO class called BeanAdapterModel that might be just
what
you need, however, I am not experienced with using it. Maybe
someone
else on my team or in the community could better explain how to
use
>
this
class.
craig
grschroeder wrote:
Venki,
Thanks for the response. Actually, I'm not sure if I can answer
all
of your questions because those are some of the same questions
that
we're trying to answer ourselves. Basically, what we're trying
to
>do
is incorporate our domain object model into the JATO framework.
My
thinking was that one way we could accomplish this was by
storing
>a
Javabean object in the HTTPSession to represent an object in the
domain model, and that the Viewbean and JATO Model could get and
set
data from there. If you have a better suggestion of how to
accomplish this, I'm definitely open to hearing it.
Thanks,
Greg
--- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
OK grschroeder , first let me get this straight:
0. Are you going to pass this object to the model, or are u
going
>
to pass the session object to the model?
1. Is there any specific reason for this approach you are
taking?
2. Will there be a notification from the object u havementioned
>to
have the model persist the data?
3. What about the reverse case, when the model refreshes the
data,
how are you going to refresh you object?
4. The JavaBean Object that u are talking about, is it your own
object or is it implementation of an existing JATO interface?
~Venki
grschroeder wrote:I'm fairly new to JATO, but I think I now
have
>a
basic understanding
of how Viewbeans and Models interact. However, I want to
incorporate
the use of a Javabean object that will be stored in the HTTP
session
and will act as the connection between the Viewbean and Model
instead
of having the Viewbean and Model interact directly with each
other.
Basically I would like to have the Model set data in the object
stored in the session so that the Viewbean can pull it out to
display
it. And vice versa, once the user modifies the data and is
ready
>
to
persist it, I would like to have the Viewbean set data in the
object
stored in the session so that the Model can pull it out to
store
>it
in the database. I'm not sure what the best approach would be
to
accomplish this. Any help you could give would be greatly
appreciated.
Thanks,
Greg
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Service.
Venki
IT Solutions
#6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
91-44-4925740(Home) 91-44-8212877(Work)
* Luck is what happens when Preparation meets Opportunity.
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jspPersonally, I think there is little or no value to creating a "domain"
object that itself relies on a JATO QueryModel internally, but hides that
fact and requires use of BeanAdapterModel.
It would be more appropriate (and much less work, and more scalable) to just
derive a QueryModel subclass and add the domain-specific behavior to the
model. In other words, what's the point of creating an object that hides
JATO inside it when you're running in JATO to begin with? Now if the domain
object were doing plain JDBC, and thus trying to be JATO independent, that
would be different. However, you could still implement the Model interface
on the object (or use BeanAdapterModel) to integrate it seamlessly with the
View tier.
Todd
----- Original Message -----
From: "grschroeder" <grschroeder@y...>
Sent: Wednesday, July 31, 2002 12:00 PM
Subject: [SunONE-JATO] Re: Using an object to store and display data
Craig,
I think it all finally makes sense. First, your assumption is
correct regarding the process flow. The ViewBean will interact with
a custom Javabean which will then in turn interact with a SQL Model
to access the database. So now let me make sure I understand what I
need to do. Basically the custom Javabean will have a method to get
the SQLModel. I would then invoke the setValue method on the
SQLModel and call the appropriate execute method( e.g.,
executeUpdate, etc. ) just like I would do from a ViewBean. Does
this sound correct?
Thanks,
Greg
--- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
wrote:
Greg,
see below...
grschroeder wrote:
Thanks for the help Craig. I looked at the sample code that makes
use of the BeanAdapterModel. Basically it looks like it allows a
view to interact with a bean the same way it would interact with
any
other model. That part I think I understand.
This is correct.
The part I'm a little
unclear on still is how to interface this BeanAdapterModel( which
is
a very basic model ) that I now have with a query model toactually
interact with the database.
Not sure what you mean by "interface this BeanAdapterModel ... witha
query model". Does this mean that you have a ViewBean the interactswith
a custom JavaBean via the BeanAdpterModel wrapper, and from the
JavaBean you are interacting with the SQL Model?
So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
SQL Model > RDBMS
That's what I am reading anyway. Please explain this to me.
Would I need to make direct JDBC calls
from my custom model instead of letting JATO dynamically create
the
calls for me?
If my assumptions above are correct, then the custom JavaBean cansimply
use the SQL Model in exactly the same manner as the ViewBean,otherwise,
if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
which is fine, if you do it "right" (connection pooling, result set
handling, etc.).
Thanks,
Greg
--- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
wrote:
I think the best approach would be to treat your Domain Objects
(DO) as
the Database (the enterprise tier) from JATO's perspective. You
could
create custom models that interface with our DO's and then the
JATO
Views could easily bind to the custom DO models just like anyother
model. This should eliminate the need for pushing data/objectsfrom
>
view
to model to database.
There is a JATO class called BeanAdapterModel that might be just
what
you need, however, I am not experienced with using it. Maybe
someone
else on my team or in the community could better explain how to
use
>
this
class.
craig
grschroeder wrote:
Venki,
Thanks for the response. Actually, I'm not sure if I can answer
all
of your questions because those are some of the same questions
that
we're trying to answer ourselves. Basically, what we're trying
to
>do
is incorporate our domain object model into the JATO framework.
My
thinking was that one way we could accomplish this was by
storing
>a
Javabean object in the HTTPSession to represent an object in the
domain model, and that the Viewbean and JATO Model could get and
set
data from there. If you have a better suggestion of how to
accomplish this, I'm definitely open to hearing it.
Thanks,
Greg
--- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
OK grschroeder , first let me get this straight:
0. Are you going to pass this object to the model, or are u
going
>
to pass the session object to the model?
1. Is there any specific reason for this approach you are
taking?
2. Will there be a notification from the object u havementioned
>to
have the model persist the data?
3. What about the reverse case, when the model refreshes the
data,
how are you going to refresh you object?
4. The JavaBean Object that u are talking about, is it your own
object or is it implementation of an existing JATO interface?
~Venki
grschroeder wrote:I'm fairly new to JATO, but I think I now
have
>a
basic understanding
of how Viewbeans and Models interact. However, I want to
incorporate
the use of a Javabean object that will be stored in the HTTP
session
and will act as the connection between the Viewbean and Model
instead
of having the Viewbean and Model interact directly with each
other.
Basically I would like to have the Model set data in the object
stored in the session so that the Viewbean can pull it out to
display
it. And vice versa, once the user modifies the data and is
ready
>
to
persist it, I would like to have the Viewbean set data in the
object
stored in the session so that the Model can pull it out to
store
>it
in the database. I'm not sure what the best approach would be
to
accomplish this. Any help you could give would be greatly
appreciated.
Thanks,
Greg
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Service.
Venki
IT Solutions
#6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
91-44-4925740(Home) 91-44-8212877(Work)
* Luck is what happens when Preparation meets Opportunity.
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Maybe you are looking for
-
I want to burn all the one-starred images in a project to a disc, and was wondering if there is a way to do it directly from Aperture, instead of having to export them to a file, and then burn them to the disc. Also, when I do this, shots from multi
-
Catching the exception thrown in a java class on a JSP front end
I have a web service created in JAVA.. The modules throw certain exceptions and i am having auto generated JSP created from the WSDL's , which i can obviously edit. i want to catch these exceptions in this JSP page.. Any clue how to do this? Thanks.
-
Windows 7 Home Premium, SP1 64-bit I just installed SQL Server 2012 express - Express with Advanced Services (contains the database engine, Express Tools, Reporting Services, and Full Text Search), file name - SQLEXPRADV_x64_ENU. Opening SQL Server
-
Hello! I need to do the following: - apply a servlet-filter to all files in a directory - NOT apply that filter to the sub-derictories. I'm using Tomcat 5.5. What should be the uri-pattern of that filter? Is there some directive for "Exclude"? Thanks
-
Resend Text Settings question - N8 Belle
Is there a way i can set the resend time for txt? you know when the message failed to send it will automatically send message again after 5mins, but 5 mins is too long., i want it to resend after a minute or so. 5 mins and this resend became so usele