Simple Date formatter problem
Hi im using
SimpleDateFormatter
SimpleDateFormat sdfInput = new SimpleDateFormat("dd-mmm-yyyy");
Date ddval = sdfInput.parse(afterDate);
where afterdate is a string 10-jan-2002.
but im getting the parse exception
ParseExceptionUnparseable date: "10-Jan-2002"
can any body help me
thanx mall
Change the pattern inside the SimpleDateFormat from dd-mmm-yyyy to "dd-MMM-yyyy".
Since 'm' corresponds to minutes and 'M' corresponds to Month.
Similar Messages
-
Help with simple date formatter
hi i have a text box which has a date , day , time on it, i would like to use simple date formatter and change the format...
i would like to get the day part alone getin displayed below the text box,
any suggestions?Yes. Read the SimpleDateFormat API docs about specifying formatting patterns.
-
Date formatt problems..
when i retreive a date value from oracle it is displaying in yyyy-mm-dd formatt in my date..
but i want it to dispaly in dd-mm-yyyy formatt.
how to convert it..in java ..
plz asap reply me
regardsHi,
There are 2 ways to do it... In oracle you have built in functions like
TO_CHAR (SYSDATE, 'DD-MM-YYYY')
You can use these. Else in Java you can use SimpleDateFormat Class to convert it
SimpleDateFormat formatter = new SimpleDateFormat ("MM-dd-MM-yyyy");
formatter.format(date);
Thanks and regards,
Pazhanikanthan Periasamy,
Senior Software Engineer,
IT Solutions India Pvt. Ltd.,
Madras - 600 006 -
I am having trouble with the following code. It works fine on one computer but not on another.
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
Date date22 = cal.getTime();
System.out.println(date22);
String details = sdf.format(date22);
System.out.println(details);
StringTokenizer str = new StringTokenizer(details, "-", false);
The working ones output is:
Thu Jul 14 12:06:33 GMT 2005
14-07-2005-12-06-33
However on the computer where it doesn't work, I get this:
Fri Aug 05 13:13:59 BST 2005
Exception in thread "Thread-0" java.lang.NullPointerException
Which point to line: String details = sdf.format(date22);
From what I can see, the only difference is BST instead of GMT, but I can't seem to change this.
It is running under Windows.
Any help will be MUCH appreciated, as I am stumped!
Thanks. :)The difference is that in the latter sdf is never assigned a non-null value. Since you didn't post the code that initializes sdf, we've got no way of knowing what went wrong.
-
Help : Simple Date Formats Problem in JDev11 [TP4] ?
Hi ;
I use ADF/JSF in JDeveloper 11 [TP4].
in JSF Page
what can I do to enter Date format mask dd-mm-yyyy hh:mi:ss
to Return my Date Format mask like
mi-mm-yyyy meaning minute-month-year
in another column ?
and I know The format mask is defined in a File called formatinfo.xml .
Thanks & Regards
ForakoraHi,
if it is for display then you don't need to change it in the model but can link the output text component to a managed bean that gets the stored date value to then change it to the format you prefer. This however may not be suitable if the date should be updated from that column -
10.1.2: Problem with ConrolHint Date-Formatter
Hi,
when defining an control hint of format type Simple Date and format "yyyy-MM-dd G 'at' hh:mm:ss" in an EO the business components browser shows values like "2005-01-04 n. Chr. at 12:00:00". But the SQL column contains a correct time fragment like "9:35:21.0". Without control hint definition the value is displayed as "2005-01-04 9:35:21.0" !!
The attribute is defined as DATE/oracle.jbo.domain.Date.
Any workaround?
With JDev9052 I get the same results! Please, have a look at Date (Formatter) problem in JDev 9052
MarkusHello,
is is bug really not fixed?
When I take a look at the Entries in the Bug Fixed List
(Bugs Fixed in Oracle JDeveloper 10g 10.1.2), I would have though differently:
2825228 3730910 BC4J RT DEFAULTDATEFORMATTER DOES NOT SUPPORT NEW TIMESTAMP DOMAIN?
3730910 BC4J DOMAIN TIMESTAMP DOMAIN NOT EQUIVALENT TO JAVA.SQL.TIMESTAMP, FORMATING BROKEN?
3668688 3730910 BC4J DATA_TAGS TIME VALUES NOT SHOWN IN JSP - WHEN USING SQL DIALECT SQL92?
Or is this referring to an other problem?
Greetings
Harald. -
Problem with central build of Simple Date Type with Enumeration
Dear gurus,
I hope I'm posting this in the correct forum. Please advise if I'm in the wrong forum.
I have a Web Dynpro DC in which I've created a simple data type with enumeration. It is used for binding to a radio box. The data type is called DownloadType; the enumeration contains two vales: current and archive. To allow me to access the enumeration values, I turn on the "Generate a class representation of the enumeration" in the data type builder.
I then reference the enumeration values with code like:
if (downloadType.equals (DownloadType._CURRENT))
yada yada yada
This works fine when building locally and deploying directly. But when the DC is built by CBS (or doing a "Development Component->Build..." in NW Dev Studio), the build fails, stating that the DownloadType._CURRENT symbol cannot be resolved.
For example:
C:yadayadayada.java:227: cannot resolve symbol
symbol : variable _CURRENT
location: class yadayadayada.DownloadType
equals(DownloadType._CURRENT)) {
Apparently the central builder is not smart enough to handle the "Generate a class representation" flag.
Is this a known problem? Are there any workarounds?
Thanks in advance for any help you can provide.
-Kelly
P.S. Environment: 2004sHi Kelly,
works for me using SP10, what SP are you on?
There's a line in the DC log that says:
[ddgen] [Info] Generating datatypes/com/x/x/x/MyEnum.java
and the java compiler includes the matching path for compilation:
[echo] source paths:
[echo] ...\_comp\src\packages
[echo] ..\t\ABF37B5AFB3B2E8A76FFD29E7862EA48\gen_ddic\datatypes
Regards,
Marc -
Hello,
I'm stuck against a simple date query and need some help. Can anyone please shed some light on this?
Our Environment is: oracle 8i and SYsdate format is: GMT.
I have a table say employee with the following fields;
Employee_id,employee_name,hire_date,is_new
I have to find:
Select employee_name
From employee
Where is_new = Y
And hire_date between (00 GMT) and now.
So, my problem is:
How do I do the AND Clause?
How can I get between 00GMT of today and now.
Any help will greatly be appreciated. THanks in advance
simakYou could also use
Select employee_name
From employee
Where is_new = Y
And hire_date >= trunc(sysdate); -
Hi,
I have an entity object with some attributes, one of them is called "CREATED_ON", which i have specified as a history column (created on).
I have specified a format type of Simple Date in my Control hint and a format of dd-MM-yyyy. I then created a view based on my entity and dragged the view as an adf creation form. I also dragged a commit button to commit my record.
However, the date that is stored in my database have a non-zero time component (e.g. 10-JUL-2007 10:46:22). This is a problem becuase in my search form, the search criteria does not work (it requires the exact time also to work). I do not want to use TRUNC in my SQL query.
Instead i want the date to be stored with the format mask that i have specified.
Can you please help me?
Thank youDo you really want to lose the time component altogether, or just make the query on date-without-time work?
There would be no way of recovering the information about when during the day the row was created if you truncate the time information, but it's possible to achieve if that's what you want. Both are possible to achieve.
To achieve the "losing the current time info forever" approach, add the following overridden method in your entity impl class that slightly changes the way the history attribute value is returned, in my case, for the HIREDATE attribute of an Emp example:
protected Object getHistoryContextForAttribute(AttributeDefImpl attributeDefImpl) {
Object ret = super.getHistoryContextForAttribute(attributeDefImpl);
if (attributeDefImpl.getIndex() == HIREDATE) {
ret = new Date(new java.sql.Date(((Date)ret).getValue().getTime()));
return ret;
}To achieve # 2 instead, just add a SQL-derived attribute to the view object with formula:
TRUNC(HIREDATE)and then use that sql-derived attribute in the query form instead of the normal HIREDATE attribute. -
Flash Builder 4 Beta 2 ---- Data Management Problem
Flash Builder 4 Beta 2 ---- Data Management Problem
I have a simple datagrid, a PHP service and a MySQL database. When I run the code I get multiple(7) records returned to the datagrid. Once I enable Data Management and run the exact same code, I only get 1 record returned.
Is there a setting in Data Management that affects the number of records returned?
Here is the MXML code I am testing.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768" xmlns:carasgndataphp="services.carasgndataphp.*">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
var inptdata:String = "1";
protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
getAsgnDataResult.token = carAsgnDataPHP.getAsgnData(inptdata);
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getAsgnDataResult"/>
<carasgndataphp:CarAsgnDataPHP id="carAsgnDataPHP" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:DataGrid x="115" y="91" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getAsgnDataResult.lastResult}" width="558" height="298">
<mx:columns>
<mx:DataGridColumn headerText="A" dataField="numAsgn"/>
<mx:DataGridColumn headerText="T" dataField="numTopic"/>
<mx:DataGridColumn headerText="U" dataField="numUnit"/>
<mx:DataGridColumn headerText="P" dataField="numProblem"/>
<mx:DataGridColumn headerText="TP" dataField="PType"/>
<mx:DataGridColumn headerText="P" dataField="numSeqPresent"/>
<mx:DataGridColumn headerText="F" dataField="numSeqFeedback"/>
<mx:DataGridColumn headerText="D" dataField="numDelay"/>
<mx:DataGridColumn headerText="ID" dataField="idAsgnData"/>
<mx:DataGridColumn headerText="IDP" dataField="idProblem"/>
</mx:columns>
</mx:DataGrid>
</s:Application>Hello,
Data Mangement expects unique values for id property.This issue may occur when you select 'Identity' property in Data Mangement wizard which is not unique in the Table.For eg:, you have selected 'name' field as identity property. And your MySQL database table has multiple rows with identical values for 'name' column.
Can you verify if you have similar setup?
Thanks,
Radhakrishna -
AS3 Data Coercion Problem
From PHP server RemoteObject AMF3 serialization, I receive a
photo object per below into my Flex client:
package WPhoto {
[Bindable]
[RemoteClass(alias="WPhoto.PhotoObj")]
public class PhotoObj {
public var photo:*;
public var photoWidth:int;
public var photoHeight:int;
The above 'photo' property String of a one-byte (UTF-8)
'.jpg' photo data. Due to PHP's rather limited set of primitive
data types this is the best I can do per returning photo data to
the Flex client. (Extreme tries at PHP data structure chicanery
hasn't worked for me.)
I need photo property in a DisplayObject format such that I
can render photo as a child of my App's DisplayObject. The AS3
Loader class performs this task, when sourced from an AS3
ByteArray.
o Loader.loadBytes(bytes:ByteArray, context:LoaderContext =
null):void
Loads from binary data stored in a ByteArray object.
My dilemma is "how to" convert a UTF-8 string of photo data
into a ByteArray. I've been through the ByteArray.writeXXX() class
methods without finding anything close to meeting my requirements.
AS3 String readers expect UTF-16 data, so reading AS3 string
reading is not a solution. AS3 has no Byte data type, accordingly
reading my photo data UTF-8 string with a "for loop" into a AS3
UTF-16 string, or whatever, is not viable. Is there a single-byte
reader to 'whatever' writer I'm not aware of?
If I was sourcing photos from a Java based server, my photo
rendering dilemma would be over. The server to client packets would
be "java.lang.Byte[]" => flash.utils.ByteArray and voilà we
could easily and directly render photos via the Loader.loadBytes()
method.
I can tentatively extend one of the AS3 ByteArray class write
methods if I thought there was a way to read UTF-8 streams. Before
digging down into the ByteArray class on a feasibility basis, I
thought it first best to ask around the experts per 1) can
ByteArray be extended for my requirement, or 2) is there a better
way to approach this, which I have not thought of?
Pete Mackie
Seaquest Software
Adobe Community Expert - FlexHi,
Thanks for the quick reply.
I simply don't get it.
I have a root class which adds two different children of
different classes. One child dispatched an event, and the other is
supposed to get it. Both of the are now supposed to be in the
instance hirrarchy, or am I wrong?
Logically, I'd figure this should work smooth and simple
without any need for any looping or such.
Right now, the root class can recieve the event dispatched by
child1, but I can't make child2 recieve any event dispatched by
either the root or child1.
I'd appreciate if you could show me the way...
thanks again,
EZ42 -
Date Format problem...
Hi users,
Forte version : 2.e.2 and ForteWebSDK
Datacase : Oracle
We have a problem with a simple HTML text field which acccepts
a date. When we try to update the record with some date, the following
exception occurs:
24-Jun-1998 04:32:28 : XV01086 : Execute failed for SQL statement in
project Rap
tServices, class RaptSqlMethods, method updateActivity, methodId 104,
line 51, e
rror from database is:
ORA-01830: date format picture ends before converting entire input
string
The Oracle manual says that the above exception occurs when there are
some extra characters on that field, which is not the case. In fact,
we raise our own exception for the cases like : o1-Apr-1997,
01-apr-97 etc. The correct format is 01-apr-1998.
Same date soemtimes is added to the database successfully. Waht I mean
to say that the exception deos not occur consistently.
We just conevert the String taken from the HTML field into a Forte
DateTimeData Object and send it to database. May be, the conversion
part is causing the problem. But, once again the problem is not
consistent.
Any ideas in this will be appreciated.
Thanx in advance
-Rajeev Talwar
Get Your Private, Free Email at http://www.hotmail.com
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>We had the same problem when our application first went live. The
default date format for our Oracle database is 'dd-mmm-yy' without the
time component. The default format for datatype DateTimeData is
'dd-mmm-yyyy hh:mm:ss'. Since we did not want to change the default date
format for the Database, we included in our service partitions an Alter
Session statement to change the NLS_Date_format attribute in Oracle to
conform to the Forte DateTimeData format. It worked.
Kam Chow
Mazda Australia
-----Original Message-----
From: Gary F Giger [mailto:[email protected]]
Sent: Thursday, June 25, 1998 4:11 AM
To: Rajeev Talwar
Cc: [email protected]
Subject: Re: Date Format problem...
I was having the same problem a few weeks back when I would
read/write
dates to Oracle. I was using objects of type DateTimeData and I would
occasionally get errors like you said you were. I found discovered my
problem. Sometimes I would process a null date and would get an error.
So to
resolve this issue, I simply changes my objects of type DateTimeData to
type
DateTimeNullable. This enabled my Forte Application to handle regular
dates
as well as null dates. I have not gotten any oracle errors since then
with
regards to dates. Hope this helps.
Rajeev Talwar wrote:
Hi users,
Forte version : 2.e.2 and ForteWebSDK
Datacase : Oracle
We have a problem with a simple HTML text field which acccepts
a date. When we try to update the record with some date, the following
exception occurs:
24-Jun-1998 04:32:28 : XV01086 : Execute failed for SQL statement in
project Rap
tServices, class RaptSqlMethods, method updateActivity, methodId 104,
line 51, e
rror from database is:
ORA-01830: date format picture ends before converting entire input
string
The Oracle manual says that the above exception occurs when there are
some extra characters on that field, which is not the case. In fact,
we raise our own exception for the cases like : o1-Apr-1997,
01-apr-97 etc. The correct format is 01-apr-1998.
Same date soemtimes is added to the database successfully. Waht I mean
to say that the exception deos not occur consistently.
We just conevert the String taken from the HTML field into a Forte
DateTimeData Object and send it to database. May be, the conversion
part is causing the problem. But, once again the problem is not
consistent.
Any ideas in this will be appreciated.
Thanx in advance
-Rajeev Talwar
Get Your Private, Free Email at http://www.hotmail.com
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
Gary Giger
Raytheon Systems Company
300 Science Park Road
State College, PA. 16804
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
This message has successfully passed virus checking.
Mazda Australia takes every precaution to ensure email messages are virus free. For complete protection, you should virus test this message.
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
What can be considered as the business logic of simple data entry form
Hi all,
I want to separate my applications logic into layers. It is a simple data entry form and doesn't contain any complex business logic. So I want to get this simple business logic to different layer. But the problem is, I cannot clearly identify what are business logic of this kind of simple data entry form.
How do I separate business logic of this simple data entry form to another layer?
any help is appreciated,
Thanks in advance,
Dil.dcminter wrote:
It is a [form] and doesn't contain any complex business logic. So I want to get this simple business logic to different layer. But the problem is, I cannot clearly identify what are business logic of this kind of [form].Are you asking which bits are business logic?
Suppose that the data comes into your system immaculate from some external system. Imagine that it will go out into some other system. The bits that you would still have to write are your business logic.That's a nice practical definition. Thank you, I'm stealing it.
Also interesting to note that validation falls into that category... say you're recieving data from a magical external source... you still have to validate it.
And of course you'd still have to store it somewhere, ans retrieve it.
Yep, I definately like that definition.
Cheers. Keith. -
SIMPLE Database Design Problem !
Mapping is a big problem for many complex applications.
So what happens if we put all the tables into one table called ENTITY?
I have more than 300 attributeTypes.And there will be lots of null values in the records of that single table as every entityType uses the same table.
Other than wasting space if I put a clustered index on my entityType coloumn in that table.What kind of performance penalties to I get?
Definition of the table
ENTITY
EntityID > uniqueidentifier
EntityType > Tells the entityTypeName
Name >
LastName >
CompanyName > 300 attributeTypes
OppurtunityPeriod >
PS:There is also another table called RELATION that points the relations between entities.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
check the coloumn with WHERE _entityType='PERSON'
as there is is clustered index on entityType...there
is NO performance decrease.
there is also a clustered index on RELATION table on
relationType
when we say WHERE _entityType ='PERSON' or
WHERE relationType='CONTACTMECHANISM'.
it scans the clustered index first.it acts like a
table as it is physically ordered.I was thinking in terms of using several conditions in the same select, such as
WHERE _entityType ='PERSON'
AND LastName LIKE 'A%' In your case you have to use at least two indices, and since your clustered index comes first ...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Have you ever thought of using constraints in your
modell? How would you realize those?
...in fact we did.We have arranged the generic object
model in an object database.The knowledge information
is held in the object database.So your relational database is used only as a "simple" storage, everything has go through your object database.
But the data schema is held in the RDBMS with code
generation that creates a schema to hold data.If you think that this approach makes sense, why not.
But in able to have a efficent mapping and a good
performance we have thought about building only one
table.The problem is we know we are losing some space
but the thing is harddisk is much cheaper than RAM
and CPU.So our trade off concerated on the storage
cost.But I still wonder if there is a point that I
have missed in terms performance?Just test your approach by using sufficiently data - only you know how many records you have to store in your modell.
PS: it is not wise effective using generic object
models also in object databases as CPU cost is a lot
when u are holding the data.I don't know if I'd have taken your approach - using two database systems to hold data and business logic.
PS2: RDBMS is a value based system where object
databases are identity based.we are trying to be in
the gray area of both worlds.Like I wrote: if your approach works and scales to the required size, why not? I would assume that you did a load test with your approach.
What I would question though is that your discussing a "SIMPLE Database Design" problem. I don't see anything simple in your approach when it comes to implementation.
C. -
Simple Data Type in CAF of SAP NetWeaver DevStudio 7.1 SP3
Hallo
Anybody knows about the use of Enumeration for simple Data Type in CAF of SAP NetWeaver DevStudio 7.1 SP3?
I've defined an attribute "status" for the Entity "Project" with the following values
0: NEW;
1: ACTIVE;
-1: INACTIVE.
As you see the data type is short.
In the program I want to use the following code:
Project myProject = new Project();
myProject.setStatus(Status.NEW)
But I found it out, it is inpossible to to use Status.NEW.
On the other side I read the article of https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/085098ea-0c01-0010-12a8-80ac838bec85. This article is again not updated with the version 7.1 SP 3.
I cannot understand about the whole changes. In the previous release we can define a DDIC type and use it as Simple Data type and in the new Release we just use the XSD-Facet to define an enumeration, but the problem is: we can not reference it in the program. I don't see any advantage. And I tried to find out how I can define the attibute using DDIC type. I didn't get it.
Thanks for any Hints!
Kind Regards!
PingHi Oliver,
Thanks for the reply!
I have login into the system, using User Id and Password.
I have tried unsinstalling everything but the result remains the same.
Previously only one service SAPCE_01 was showing up in the services explorer. But when I tried the
Instance 00:
sc create SAPRKT_00 binPath= "C:\usr\sap\RKT\SYS\exe\uc\NTI386\sapstartsrv.exe pf=C:/usr/sap/RKT/SYS/profile/CE1_SCS00_xxxxx" start= auto obj= "NT AUTHORITY\LocalService" password= abcd1234
Instance 01:
another service SAPCE1_00 was created. But when I tried to retry the instlattio, the installation again stopped at the point while starting the service and when I tried to retry it terminted with the following error.
Please guide.
sapinst.exe - Application Error
The instruction at "0x00cbf040" referenced memory at "0x0072006d". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
Selfextractor error
iaextract.c:888: child has signaled an exec error. Keeping directory C:/DOCUME1/I047488/LOCALS1/Temp/sapinst_exe.1448.1196681060
OK
Manish
Maybe you are looking for
-
Ensure image loaded via http connection
hi all I have a midlet that will load various images and displaying them on a canvas, upon request from the sever via HTTP connection. And since the operation are being performed via the commands, the http connection code had been placed in another t
-
Help me!! My iPod keeps skipping songs!!!
Everytime I want to listen to a song that I put on my iPod mini, then it keeps skipping to one specific song that I don't want to listen to. When I add new songs, then it stops for a while, but then it starts doing it again! Its sooooo annoying!! Ple
-
Not all non-global zones updated for DST
We have one server with Solaris 10 and four non-global zones. I installed patch 122032-03 to the global zone and it installed successfull, according to the log. With the DST change on 3/11, TWO of the non-global zones and the global zone updated corr
-
I would like to know difference between Oracle Reports6i Ver 6.0.8.11.3 & 6.0.8.10.1. We are facing some problems which we feel is due to incompatability between the 2 versions. Any information on the same would be of great help. Thanx In advance.
-
Importing Stereo files in Logic
I am trying to import stereo interleaved audio files into Logic Pro 9. When I do, the stereo files import as mono files and won't play. Is there any way around this, or is Logic only designed for mono files? This does not seem logical, although ma