How to covert from the following string to dateformat given below
String stodate = "Tue Mar 22 09:13:36 CET 2005";
Date d = new Date();
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
try
d = sdf.parse(stodate);
System.out.println(d.toString());
catch(ParseException e)
System.out.println("Unable to parse: " + stodate);
}I've got ParseException. How to solve the problem
Didn't you ask this question only a couple of minutes ago?
http://forum.java.sun.com/thread.jspa?threadID=609178
Similar Messages
-
How can we remove the following zeros from quantity field ?
Hi All.
how can we remove the following zeros from quantity field while populating ALV by using FM REUSE_ALV_GRID_DISPLAY ?
eg:getting output zqty = 2.000
but i need zqty = 2.
help me to reslove this issue.
Regards.
jayHi,
While populating the field catlog do the following thing to avoid zeros.
wa_fieldcat-tabname = 'I_OUTPUT'. " Curr
wa_fieldcat-fieldname = 'FWAER'.
wa_fieldcat-seltext_l = text-023.
wa_fieldcat-no_zero = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Thanks,
Khushbu. -
How to remove the recursion from the following method
Hi All,
Can u plz help me to remove the recursion from the following method.
The problem here is that recursion cann't be removed easily here as there is no any end condition.
hopefully waiting for the help....
Reema.
private FilterStatement processCustomExpressions(FilterStatement statement,
DistinguishedName tenant, LdapDao ldapDao)
throws NameNotFoundException,
LDAPServerException, NamingException {
HashMap relMap = new HashMap();
HashMap replaceMap = new HashMap();
Vector relVec = null;
FilterSubExpressions expressions = statement.getExpressions();
FilterPartIterator it = (FilterPartIterator)expressions.iterator();
while (it.hasNext()) {
FilterExpression e = (FilterExpression)it.next();
if (e instanceof CustomExpression) {
CustomExpression ce = (CustomExpression)e;
try {
FilterExpression fe = ce.createExpression();
if (fe instanceof RelationshipExpression) {
RelationshipExpression re = (RelationshipExpression)fe;
it.replace(re);
relVec = (Vector) relMap.get(re.name);
if(relVec == null) {
relVec = new Vector();
relVec.add(re);
}else {
relVec.add(re);
it.remove();
relMap.put(re.name, relVec);
} else if (fe instanceof SystemExpression) {
SystemExpression se = (SystemExpression)fe;
it.replace(se);
} catch (FilterEvaluationException fe) {
traceLogger.exception(Level.DEBUG_MIN, this,
"processCustomExpressions(" + statement.toString() + ")", fe);
SystemLog.getInstance().logError(this,
"processCustomExpressions(" + statement.toString() + ")", fe.getMessage());
replaceRelationshipExpressions(statement, tenant, ldapDao, relMap);
processContainerBasedExpressions(tenant, ldapDao, relMap, replaceMap);
FilterSubStatements statements = statement.getStatements();
FilterStatement temp = null;
if (statements.size() != 0) {
FilterPartIterator iter = (FilterPartIterator)statements.iterator();
while (iter.hasNext()) {
temp = (FilterStatement)iter.next();
temp = processCustomExpressions(temp, tenant, ldapDao);
iter.replace(temp);
if(!replaceMap.isEmpty())
return replaceContainerBasedExpressions(statement, replaceMap);
return statement;
}I think one of the reasons that noone will reply to your posting is that you take it a bit too easy. First of all, please use the "code" button to format your code listings. Then it will look like this (see below) and everybody can at least read it!
private FilterStatement processCustomExpressions(FilterStatement statement,
DistinguishedName tenant,
LdapDao ldapDao)
throws NameNotFoundException, LDAPServerException, NamingException {
HashMap relMap = new HashMap();
HashMap replaceMap = new HashMap();
Vector relVec = null;
FilterSubExpressions expressions = statement.getExpressions();
FilterPartIterator it = (FilterPartIterator) expressions.iterator();
while (it.hasNext()) {
FilterExpression e = (FilterExpression) it.next();
if (e instanceof CustomExpression) {
CustomExpression ce = (CustomExpression) e;
try {
FilterExpression fe = ce.createExpression();
if (fe instanceof RelationshipExpression) {
RelationshipExpression re = (RelationshipExpression) fe;
it.replace(re);
relVec = (Vector) relMap.get(re.name);
if (relVec == null) {
relVec = new Vector();
relVec.add(re);
else {
relVec.add(re);
it.remove();
relMap.put(re.name, relVec);
else if (fe instanceof SystemExpression) {
SystemExpression se = (SystemExpression) fe;
it.replace(se);
catch (FilterEvaluationException fe) {
traceLogger.exception(Level.DEBUG_MIN, this,
"processCustomExpressions("
+ statement.toString()
+ ")",
fe);
SystemLog.getInstance().logError(this,
"processCustomExpressions("
+ statement.toString()
+ ")",
fe.getMessage());
replaceRelationshipExpressions(statement, tenant, ldapDao, relMap);
processContainerBasedExpressions(tenant, ldapDao, relMap, replaceMap);
FilterSubStatements statements = statement.getStatements();
FilterStatement temp = null;
if (statements.size() != 0) {
FilterPartIterator iter = (FilterPartIterator) statements.iterator();
while (iter.hasNext()) {
temp = (FilterStatement) iter.next();
temp = processCustomExpressions(temp, tenant, ldapDao);
iter.replace(temp);
if (!replaceMap.isEmpty())
return replaceContainerBasedExpressions(statement, replaceMap);
return statement;
}Second, when you cannot understand your own code anymore, simplify it! As far as I can see, there are two "main" processes (i.e. loops) in your method, where the second one calls the method recursively. Split the method into two. Furthermore, write a third method that processes the iterated elements and call that method from out of the loops.
I did'nt analyse your method and have no idea what it does at all. I'm merely telling my first impression.
Good luck. -
How to convert from military time (string) to regular time?
How to convert from military time (string) to regular time?
First of all I need to let you know I'm very new to Crystal Reports, so I apologize and will need detailed instructions if possible.
I have created a Crystal Report pulling information from the received time field. On the report, the time is showing in military time (ex. 16:00:00).
How can I convert this time to normal time (ex. 4:00:00)
Since the field is a 'String' field and not a 'Time' field, I do not have the option of changing it under the field properties.
I hope someone can help with this.
Thank you in advance.As my fields were date only and not datetime, I ended up using the following,
If IsDate({CallLog.EmailRecdDate}) Then
CDate({CallLog.EmailRecdDate})
Else
CDate(0,0,0)
You answer lead me in the right direction.
I'm still having an issue with the 'Else' statment returning 12:00:00 because of the CDate(0,0,0), but I'm not sure what else I can use to return a blank space on the report. Any ideas?
Thanks again! -
Delete all entries from the following tables - Follow-up Activities (oracle)
Hello,
I performed a homogeneous system copy of our development BW system with the database (oracle 11.2.0.3) from the BW production system!
I already start the oracle database and the SAP system in the target system/server (development BW system) and I´m doing some follow-up activities. One of this activities is (at the system copy guide 6.2.3.2 Activities at Database Level) is to delete all entries from the following tables:
DBSTATHORA, DBSTAIHORA, DBSTATIORA, DBSTATTORA
I tried to delete them using SQL Plus:
sqlplus /nolog
SQL> connect /as sysdba
SQL> delete from DBSTATTORA;
delete from DBSTATTORA
ERROR at line 1:
ORA-00942: table or view does not exist
... and it show me that error message.
This is strange because when I go to transaction SE14 and check the DBSTATTORA I see that table exist and contain a lot of entries!
Why this is happened in SQL Plus!? I´m running the correct SQL statement for doing this type of task or not?
How can I delete the entries of that tables? Can I do that using the transaction SE14?
Can you help me please?
Thank you,
samid raifHello
sqlplus /nolog
SQL> connect /as sysdba
SQL> delete from DBSTATTORA;
delete from DBSTATTORA
ERROR at line 1:
ORA-00942: table or view does not exist
It doesn't surprise me as you are not mentioning the schema name here. Instead it should be
delete from SAPSR3.DBSTATTORA;
Assuming the schema owner is SAPSR3. if the owner is different then replace that with the correct one.
Regards
RB -
How to query from the xml table a single, specified element.
I'm quite new in Xml Db. Pleas, can anybody tell me how to query from the xml table below a single element (i.e. the element 'rapportoparentela = NIPOTE' related to the element 'codicefiscale = CRRVNC76R52G337R', or the element 'rapportoparentela = FIGLIO' related to the element 'codicefiscale = CRRRNT51L23G337Q')?
- <dati xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<codiceinterno />
<codicefiscaleassistito>CRRMNL81R31G337H</codicefiscaleassistito>
- <famigliare>
<codicefiscale>CRRVNC76R52G337R</codicefiscale>
<rapportoparentela>NIPOTE</rapportoparentela>
</famigliare>
- <famigliare>
<codicefiscale>CRRRNT51L23G337Q</codicefiscale>
<rapportoparentela>FIGLIO</rapportoparentela>
</famigliare>
- <famigliare>
<codicefiscale>CBRPRN15S65E080W</codicefiscale>
<rapportoparentela>I.S.</rapportoparentela>
</famigliare>
- <famigliare>
<codicefiscale>CRRMNL81R31G337H</codicefiscale>
<rapportoparentela>NIPOTE</rapportoparentela>
</famigliare>
- <famigliare>
<codicefiscale>BCCCML54C50I845G</codicefiscale>
<rapportoparentela>NUORA</rapportoparentela>
</famigliare>
</dati>
Using SELECT extractValue(value(t),'/rapportoparentela') into result FROM NF_XMLT X,
TABLE ( xmlsequence (extract(value(X),'/dati/famigliare/rapportoparentela'))) t
I get all the elements 'rapportoparentela' and I want to get only one specified.
Regards.
PieroPiero,
you can add the condition "CRRVNC76R52G337R" to your xpath-expression like:
SELECT extractValue(value(t),'/rapportoparentela')
FROM NF_XMLT x
,TABLE ( xmlsequence (extract(value(X),'/dati/famigliare[rapportoparentela="CRRVNC76R52G337R"]'))) tto select only those famigliare-elements that have a child-element rapportoparentela with value "CRRVNC76R52G337R".
When you stored your XML in an XMLType column in the table, i think the following queries are better:
SELECT extractValue(x.your_XMLType_column,'/dati/famigliare/rapportoparentela')
FROM NF_XMLT x
WHERE extractValue(x.your_XMLType_column,'/dati/famigliare/codicefiscale')
= 'CRRVNC76R52G337R'or
SELECT extractValue(x.your_XMLType_column,'/dati/famigliare/rapportoparentela')
FROM NF_XMLT x
WHERE existsNode(x.your_XMLType_column,'/dati/famigliare[codicefiscale="CRRVNC76R52G337R"]')
!= 0 -
How to Substring from the last 3rd underscore?
Hi Friends,
I have so many strings like as given below.
PRINT_IB_0_10009473330100_I000001_FILE001_1.txt
I have to substring the value starting from last 3rd underscore to extension dot. e.g. I need a
output like I000001_FILE001_1 from the above given string.
Thanks in advance...
- Hiren ModiWell, you could use lastIndexOf three times (with the start position option) but I think it looks more like a job for a regular expression (which could also check if the file name has the pattern you're expecting.)
You might want a pattern like "[A-Z][0-9]_{6}[A-Z0-9]*_[0-9]\.txt$", depends how much these file names are expected to vary. -
Why does Firefox remove the URL from the query string?
Hello there,
I've writing a servlet to read data from a file stored on a server. I'm using an HTTP <INPUT TYPE=file > element to locate the file to be read. When I run the servlet using IE as the browser it works fine. When I try running it using Firefox, the path to the file is not included in the query string. The full URL to the file shows up in the file input text field but then mysteriously disappears from the query string. Without the path, the servlet can't locate the file and the servlet fails. How do I get Firefox to include the path in the query string or is there some other workaround for this problem. I want my servlet to work on all types of browsers.
thanks,
grantWell you may also ask it the other way. Why does Microsoft send the full path file with the input type="file" component?
The purpose of this control is to upload a file from the client to the server. That file is sent with the request.
It does not allow you to browse server files at all. Most probably you are working on your developer machine where the client IS the server, so it works right now.
It won't once they're seperate.
<input type="file"> is the wrong tool to use to browser the server. You need to write your own html pages to do that.
Cheers,
evnafets -
How to covert from .srf form to xml form
hi..... plz anybody help me to find this soloution... i am not familiar with this enviorment
how to covert from .srf form to xml form,
it's very needed
plz help me.................Hi Raj,
You can do that way, but at times what happens is, if u try changing the extension while saving it saves as "<b>Form.xml.srf</b>" wherein, still its recognized as a srf file. So, you save it as an srf first, and then, change (rename) the extension from .srf to .xml
Satish. -
Removing segment from the concatenated String...
Hi,
please any one tell me that what will be the query to separate segments from the concatenated string.
For instance, if the segment value passed is
‘000-000-abcd-10001-post-000-21000’, then the following output should get displayed.
000
000
abcd
10001
post
000
21000
Thanks in advancedtest it:
with
test_table as
select '000-000-abcd-10001-post-000-21000' as str from dual union all
select '111-222-cdef-20002-test' as str from dual
select v.str,
substr( my_str,
instr(my_str,'-',1, rn) + 1,
instr(my_str,'-',1, rn + 1) - instr(my_str,'-',1, rn) - 1
) as new_str
from (
select '-'||ltrim(rtrim(str,'-'),'-')||'-' as my_str,
str
from test_table
) v,
select level as rn
from dual,
select max(length(str) - length(replace(str,'-'))) max_len from test_table
connect by level <= max_len + 1
) pivot
where (length(str) - length(replace(str,'-'))) + 1 >= rn
order by str, rn
Query finished, retrieving results...
STR NEW_STR
000-000-abcd-10001-post-000-21000 000
000-000-abcd-10001-post-000-21000 000
000-000-abcd-10001-post-000-21000 abcd
000-000-abcd-10001-post-000-21000 10001
000-000-abcd-10001-post-000-21000 post
000-000-abcd-10001-post-000-21000 000
000-000-abcd-10001-post-000-21000 21000
111-222-cdef-20002-test 111
111-222-cdef-20002-test 222
111-222-cdef-20002-test cdef
111-222-cdef-20002-test 20002
111-222-cdef-20002-test test
12 row(s) retrieved -
How do I read the XML string using Http response/request?
When my HTTP POST action is perform, the action will return me a XML string as shown in the link, https://www.neteller.com/gateway/netdirectv4.cfm?amount=150.00&net_account=458415554241&secure_id=896365&bank_acct_num=6789¤cy=USD&merchant_id=1234&merch_transid=1102&merch_account=john123&custom_1=test123&custom_2=test123&custom_3=test123&test=1
The above XML string will be send back by one of the payment gateway.
How do I retrieve all the attribute name and value from the XML string so that it can be stored in my database?
The XML string will be as shown below:
<?xml version="1.0" encoding="ISO-8859-1"?><netdirect version="4.0">
<approval>yes</approval>
<amount>150.00</amount>
<trans_id>403070</trans_id>
<error>none</error>
<fee>4.35</fee>
<time>{ts '2006-06-23 06:14:19'}</time>
<firstname>Test</firstname>
<lastname>Test</lastname>
<email>[email protected]</email>
<custom_1>test123</custom_1>
<custom_2>test123</custom_2>
<custom_3>test123</custom_3>
<dafee>0.00</dafee>
<client_currency>USD</client_currency>
<client_amount>150.00</client_amount>
<merchant_currency>USD</merchant_currency>
<merchant_amount>150.00</merchant_amount>
<fxrate>1.0</fxrate>
</netdirect>How about parsing the XML? Check out JAXP.
http://java.sun.com/webservices/jaxp/index.jsp -
How to hide/remove the following links
how to hide/remove the following links under All My Trips tab.
the column u2018Recommended Actionsu2019 shows the link create travel plans when the trip is specific status. This link should be removed.
Whereas in the same place, if u2018Change Travel Expense Reportu2019 is shown then it should not be removedgot solution from the following document.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0ca7949-af7b-2b10-db80-ed8ca509f573?quicklink=index&overridelayout=true -
== Issue
==
I have another kind of problem with Firefox
== Description
==
how do I fix the following error, it comes up every time I open a Firefox page; "type error: Components.classes[cid] is undefined" (JavaScript Application)
== This happened
==
Every time Firefox opened
== a few months ago
==
== Troubleshooting information
==
Application Basics
Name Firefox
Version 3.6.3
Profile Directory
Open Containing Folder
Installed Plugins
about:plugins
Build Configuration
about:buildconfig
Extensions
Name
Version
Enabled
ID
Adblock Plus 1.2 true
Adobe DLM (powered by getPlus(R)) 1,6,2,49 true
AVG Safe Search 9.0.0.825 true {3f963a5b-e555-4543-90e2-c3908898db71}
AVG Security Toolbar 4.504.019.002 true avg@igeared
Fasterfox 2.0.0 false
Forecastfox 0.9.10.2 true {0538E3E3-7E9B-4d49-8831-A227C80A7AD3}
Java Console 6.0.05 true
Java Console 6.0.03 true
Java Console 6.0.07 true
Java Console 6.0.11 true
Java Console 6.0.13 true
Java Console 6.0.15 true
Java Console 6.0.17 true
Java Quick Starter 1.0 true [email protected]
Microsoft .NET Framework Assistant 1.2.1 true {20a82645-c095-46ed-80e3-08825760534b}
NoScript 1.9.9.77 true {73a6fe31-595d-460b-a920-fcc0f8843232}
Java Console 6.0.19 true
Java Console 6.0.20 true
Modified Preferences
Name
Value
accessibility.typeaheadfind.flashBar 0
browser.history_expire_days 0
browser.history_expire_days.mirror 180
browser.places.importBookmarksHTML false
browser.places.importDefaults false
browser.places.leftPaneFolderId -1
browser.places.migratePostDataAnnotations false
browser.places.smartBookmarksVersion 2
browser.places.updateRecentTagsUri false
browser.startup.homepage_override.mstone rv:1.9.2.3
extensions.lastAppVersion 3.6.3
general.useragent.extra.microsoftdotnet ( .NET CLR 3.5.30729)
keyword.URL http://au.yhs.search.yahoo.com/avg/search?fr=yhs-avg&type=yahoo_avg_hs2-tb-web_au&p=
network.cookie.prefsMigrated true
places.last_vacuum 1272511429
print.print_bgcolor false
print.print_bgimages false
print.print_command
print.print_downloadfonts true
print.print_evenpages true
print.print_in_color true
print.print_margin_bottom 0.5
print.print_margin_left 0.5
print.print_margin_right 0.5
print.print_margin_top 0.5
print.print_oddpages true
print.print_orientation 0
print.print_pagedelay 500
print.print_paper_data 0
print.print_paper_height 11.00
print.print_paper_size -134744073
print.print_paper_size_type 1
print.print_paper_size_unit 0
print.print_paper_width 8.50
print.print_printer Lexmark 4200 Series
print.print_reversed false
print.print_scaling 1.00
print.print_shrink_to_fit true
print.print_to_file false
print.printer_Lexmark_4200_Series.print_bgcolor false
print.printer_Lexmark_4200_Series.print_bgimages false
print.printer_Lexmark_4200_Series.print_command
print.printer_Lexmark_4200_Series.print_downloadfonts true
print.printer_Lexmark_4200_Series.print_edge_bottom 0
print.printer_Lexmark_4200_Series.print_edge_left 0
print.printer_Lexmark_4200_Series.print_edge_right 0
print.printer_Lexmark_4200_Series.print_edge_top 0
print.printer_Lexmark_4200_Series.print_evenpages true
print.printer_Lexmark_4200_Series.print_footercenter
print.printer_Lexmark_4200_Series.print_footerleft &PT
print.printer_Lexmark_4200_Series.print_footerright &D
print.printer_Lexmark_4200_Series.print_headercenter
print.printer_Lexmark_4200_Series.print_headerleft &T
print.printer_Lexmark_4200_Series.print_headerright &U
print.printer_Lexmark_4200_Series.print_in_color true
print.printer_Lexmark_4200_Series.print_margin_bottom 0.5
print.printer_Lexmark_4200_Series.print_margin_left 0.5
print.printer_Lexmark_4200_Series.print_margin_right 0.5
print.printer_Lexmark_4200_Series.print_margin_top 0.5
print.printer_Lexmark_4200_Series.print_oddpages true
print.printer_Lexmark_4200_Series.print_orientation 0
print.printer_Lexmark_4200_Series.print_pagedelay 500
print.printer_Lexmark_4200_Series.print_paper_data 1
print.printer_Lexmark_4200_Series.print_paper_height 11.00
print.printer_Lexmark_4200_Series.print_paper_size -134744073
print.printer_Lexmark_4200_Series.print_paper_size_type 0
print.printer_Lexmark_4200_Series.print_paper_size_unit 1
print.printer_Lexmark_4200_Series.print_paper_width 8.50
print.printer_Lexmark_4200_Series.print_reversed false
print.printer_Lexmark_4200_Series.print_scaling 1.00
print.printer_Lexmark_4200_Series.print_shrink_to_fit true
print.printer_Lexmark_4200_Series.print_to_file false
print.printer_Lexmark_4200_Series.print_unwriteable_margin_bottom 0
print.printer_Lexmark_4200_Series.print_unwriteable_margin_left 0
print.printer_Lexmark_4200_Series.print_unwriteable_margin_right 0
print.printer_Lexmark_4200_Series.print_unwriteable_margin_top 0
privacy.clearOnShutdown.cookies false
privacy.clearOnShutdown.offlineApps true
privacy.cpd.cookies false
privacy.item.offlineApps true
privacy.sanitize.migrateFx3Prefs true
privacy.sanitize.timeSpan 3
security.warn_viewing_mixed false
security.warn_viewing_mixed.show_once false
== Firefox version
==
3.6.3
== Operating system
==
Windows XP
== User Agent
==
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)
== Plugins installed
==
*-getplusplusadobe16249
*Office Plugin for Netscape Navigator
*Adobe PDF Plug-In For Firefox and Netscape
*Default Plug-in
*NPRuntime Script Plug-in Library for Java(TM) Deploy
*The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
*Shockwave Flash 10.0 r45
*iTunes Detector Plug-in
*Garmin Communicator Plug-In 2.8.1.0
*Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
*Java(TM) Platform SE binary
*Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
*Npdsplay dll
*DRM Store Netscape Plugin
*DRM Netscape Network ObjectHow do I fix this problem ...javascript (cid) applications.
-
How do I fix the following error? itunes counld not back up the iphone because the back up could not be saved on the computer?
I updated to iOS 5.0.1 days ago and didn't receive that notification until just now...
This time I synced new photos I took yesterday, and it gave me the:
"iTunes Sync: 54 items could not be synced. See iTunes for more information"
Perhaps it kicks off when new items get synced.
I've decided to rent a movie yesterday. Once it gets deleted, I'm curious to see if it jumps to 55 items. -
how do I get the following to the left of my search bar: <> one page, X, reload page?
The reload page button is no longer an option in Safari—it's been integrated into the URL bar itself. For the other buttons, you can right-click (Control-click) on the toolbar, select "Customize Toolbar", and drag the buttons on to any part of the bar.
Maybe you are looking for
-
how can I add data (Object[][]) to an existing Jtable without creating the Jtable again or setting up a new TableModel for this Jtable. Thanks you
-
Title says it all...
-
HELP PLEASE!!! ipod will not update!!!
i have had my ipod mini for a little over a year. i currently have about 900 song on my Itunes Library. However, once i got to almost 900 songs, my itunes started saying that "songs on the ipod cannot be update because all of the playlists selected f
-
Black Screen After Wakeup / Sleep failure code 0x00000000 0x1f006500
Problem waking up from sleep on my mid-'09 MacBook Pro 5.4 running Lion. Bought new, under 2 years old. Upgraded RAM to 8GB and installed an SSD around Janurary this year. Problem started under Snow Liopard no more than a couple weeks back from today
-
How to create drill down report in sap query
how to create drill down report in sap query ,