Simple help with DOM parsing - urgent
hi,
i'm new to xml parsing and have a simple (i think) question.
i have the following xml
<record>
<header>
<id>1</id>
</header>
</record>
<record>
<header>
<id>1</id>
</header>
</record>
i'm trying to parse first the records then from a record parse the header and from it get the id in the following way:
NodeList nodeList = org.apache.xpath.XPathAPI.selectNodeList(doc, "//*[name() = 'record']");
for every element i in the nodeList
Node node1 = nodeList.item(i);
Node node2 = org.apache.xpath.XPathAPI.selectSingleNode(node, "//*[name() = 'header']");
Node node3 = org.apache.xpath.XPathAPI.selectSingleNode(node2, "//*[name() = 'id]");
String id = node3.getFirstChild().getNodeValue();
even due i run in a loop and i see node1 containing the right record the other parsing gives me the always the data of the first record.
can't i parse and then re-parse on the node i got?
if the second parsing always done from the root, even due i gave the parser another node?
what am i doing wrong?
thanks in advance
alon
Your xpath & everything else looks right. I have 2 questions...
1 -- what is the length of NodeList nodeList = org.apache.xpath.XPathAPI.selectNodeList(doc, "//*[name() = 'record']"); ?
The answer should be 2, you have 2 record from the XML
2 -- both id of your record is 1. Are you seeing the same value returned because of this? What do you see if you change the second record's id to 2 ??
Similar Messages
-
Hello! I am writing a JRXML file with XML extension and trying to parse using DOM Parser.But I am getting the following Exception:
java.net.UnknownHostException: jasperreports.sourceforge.net
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at net.zycomm.reportGeneration.source.WriteJrxml.<init>(<myfilename.java>.java:44)
at net.zycomm.reportGeneration.source.WriteJrxml.main(<myfilename.java>).
I need another answer:How can I parse a JRXML file?it is a network problem, I think the DNS of your provider is not up to date so it cannot find the domain.
There must be a schema declaration at the beginning of your JRXML file. It points to a schema situated on the jasper site (which has changed recently).
The better turnaround is to find this schema, place it on your local file system (or in server's hierarchy) and to change the schema definition in the jrxml file to point to the local file -
Hey guys,
I need some help with String Parsing. i hope experts here will help me.
i'm reading a text file and getting data as String in this format
*ABR, PAT MSSA 2009 7001 B ABC Y
*VBR, SAT ZSSA 2008 5001 A CED N
*ABC, AAT CSSA 5008 001 A AZX N
*CBC, CAT FSSA 308 5001 A XCV N
Now from following lines i have to extract Number data i.e. 2009 and 7001 from 1st line. 2008 and 5001 from 2nd line and so on.
Can anyone pls suggest me any way to get the data that i want from these Strings
Thanks for your time to read this.
Regards,
samThanks for the reply
Data length can vary. ABR, PAT is the last name, First Name of the Users.
it can be following or any other combination. i just need 2 set of numbers from the complete line rest i can ignore. Any other way to get that
*ABRaaassd, PATfffff MSSA 2009 7001 B ABC Y
*VBRaa, SATaa ZSSA 2008 5001 A CED N
*ABC, AAT CSSA 5008 001 A AZX N
*CBC, CAT FSSA 308 5001 A XCV N -
PLEASE help with JavaScript parsing of WSDL return
Can someone help with parsing return WSDL data?
My return WSDL data is a concatenated string of alias names (firstname middlename lastname generation) delininated with an "@":
7433|ALIAS|John|W|Smith| @7432|ALIAS|Johnny| |Smith| @7430|ALIAS|JJ| |Smithers| @7431|ALIAS|JJ| |Smith| @7400|ALIAS|Jon| |Smith| @7416|ALIAS|John|Wilber|Smith|JR
I must have these names appear on my forms in a "lastname, firstname middlename generation" format. Can anyone provide expertise in this area if I provide the table.column reference?
alias.alternate_id = tmp[0];
alias.type = tmp[1];
alias.firstname = tmp[2];
alias.middlename = tmp[3];
alias.lastname = tmp[4];
alias.generation = tmp[5];Can someone help with parsing return WSDL data?
My return WSDL data is a concatenated string of alias names (firstname middlename lastname generation) delininated with an "@":
7433|ALIAS|John|W|Smith| @7432|ALIAS|Johnny| |Smith| @7430|ALIAS|JJ| |Smithers| @7431|ALIAS|JJ| |Smith| @7400|ALIAS|Jon| |Smith| @7416|ALIAS|John|Wilber|Smith|JR
I must have these names appear on my forms in a "lastname, firstname middlename generation" format. Can anyone provide expertise in this area if I provide the table.column reference?
alias.alternate_id = tmp[0];
alias.type = tmp[1];
alias.firstname = tmp[2];
alias.middlename = tmp[3];
alias.lastname = tmp[4];
alias.generation = tmp[5]; -
Help With Radio Buttons -- URGENT!!
Hi i am new to using UI compents in flash.
Basically i havnt a clue where to start.
Just some simple action script will help and be much
appreciated if someone can give me it.
Basically i have a question to ask which requires radio
buttons to answer the question.
I have a question and the answers are A, B, C, D.
I want:
A to equal 1
B to equal 2
C to equal 3
D to equal 4
E to equal 5
Would someone be able to tell me how to set up the radio
button so that the value of the radio button is stored into an
array called SCORE.
i dont need a tutor for arrays, i can do them, i just need
help with the radio buttons so a reference to an array would be
enough, eg how to store the answer from the radio button in an
array.
Thank youPlace the radio buttons on the stage and set their parameters
to what you need. Make sure that for each group of radio buttons
you give them the same group name. Then you could use something
like this:
var listenerObject:Object = new Object();
var answerArr:Array = new Array();
listenerObject.click = function(eventObj:Object) {
answerArr.push(eventObj.target.selectedData);
trace(answerArr);
radioGroup.addEventListener("click", listenerObject);
radioGroup refers to the group name for the buttons.
eventObj.target will refer to the actual radio button
clicked.
Tim -
Please Help with text parsing problem
Hello,
I have the following text in a file (cut and pasted from VI)
12 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 ^M
12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 ^M
12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 ^M
12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 ^M
12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 ^M
12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 ^M
this method reads the text from a file and stores it in a ArrayList
public ArrayList readInData(){
File claimFile = new File(fullClaimPath);
ArrayList returnDataAL = new ArrayList();
if(!claimFile.exists()){
System.out.println("Error: claim data - File Not Found");
System.exit(1);
try{
BufferedReader br = new BufferedReader(new FileReader(claimFile));
String s;
while ((s = br.readLine()) != null){
System.out.println(s + " HHHH");
returnDataAL.add(s);
}catch(Exception e){ System.out.println(e);}
return returnDataAL;
}//close loadFile()if i print the lines from above ... from the arraylist ... here is waht i get ...
2 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 HHHH
HHHH
I see the ^M on the end of the lines ... but i dont understand why im getting the blank lines
in between each entry ... I printed "HHHH" just to help with debugging ... anyone have any ideas why i am getting the extra blank lines?
thanks,
jdmaybe its a FileReader deal.. Im not sure, maybe try using InputStreams. This code works for me (it reads from data.txt), give it a try and see if it works:
import java.io.*;
public class Example {
public Example() throws IOException {
BufferedReader b = new BufferedReader(new InputStreamReader(new FileInputStream("data.txt")));
String s = "";
while ((s = b.readLine()) != null) {
System.out.println(s);
b.close();
public static void main(String[] args) {
try {
new Example();
catch (IOException e) {
e.printStackTrace();
} -
I got the following code from the Java DOM walkthrough. I am trying to enhance it. I want to build an XML file with my DOM. and then right the new XML to a file. I want to learn how to do it. It's not about being efficient.
How do I add child elements to this with child tags and then give them values? If you look at the code, it creates a root, then appends a 'child', but I don't see how its giving the child an element name. it just looks like its giving it a value.
public static void buildDom()
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
try {
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.newDocument(); // Create from whole cloth
Element root =
(Element) document.createElement("rootElement");
document.appendChild(root);
root.appendChild( document.createTextNode("Some") );
root.appendChild( document.createTextNode(" ") );
root.appendChild( document.createTextNode("text") );
} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
pce.printStackTrace();
} //If you're looking to build up simple documents, Dom4J might be your best choice: http://www.dom4j.org/
Combining two examples from their Quick Start guide, here's the code to do what you want (note: it hasn't been compiled, just copied from the Dom4J website with some strings changed):
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
public class Foo {
public Document createDocument() {
Document document = DocumentHelper.createDocument();
Element root = document.addElement( "root" );
Element value1 = root.addElement( "value1" )
.addText( "myVal " );
Element author2 = root.addElement( "value2" )
.addText( "myVal2" );
return document;
public void write(Document document) throws IOException {
// Pretty print the document to System.out
OutputFormat format = OutputFormat.createPrettyPrint();
writer = new XMLWriter( System.out, format );
writer.write( document );
} -
Need help with XML delay URGENT!!!
Hi i need help making a flash movie to load everything from
xml. It has to load text, images and flv, but, it has to load them
and end them at the time said in the xml. So flash loads and
unloade the text or image or video at the time specified in the
XML! PLEASE HELP I NEED THIS DONE TODAY!!!!! VERY IMPORTANT!!!
Contact me by msn [email protected] or send mail or
reply here!!It was probably a little unclear initially (no offence
intended ) whether your problem was with getting the data from XML
or with the sequencing aspect. I assume that its the sequencing
aspect based on your recent reply.
So if it was me I would parse the loaded info into Date
objects for the load and remove times and have this information
handled by some sort of sequencing code.
At its simplest, you could compare the xml-derived date/times
for load/unload with the current system date/time and use a
setInterval function to initiate the load after the calculated
difference in milliseconds has passed. Similar for the removeclip
timing. -
Need help with input, parsing, and loop in one program
I am doing an assignment that is supposed to:
# ask the user for a URL
# For the entered URL, read all the HTML text from the page and extract all links (other URLs) and image names. These should be printed to the console window.
# Reprompt for a URL until the user presses the cancel button.
# Define at least one helper method that serves a practical purpose that your main method will use. Note that your method(s) should serve a useful purpose, and it should make sense that they are separated out from the main method.
So far, I figured out how to ask if the user would like to play again, though I can't make it loop to play again. The "NO_OPTION" works fine and exits out.
I cannot figure out at all how to ask for the URL and then use that URL to try to parse the HTML to find the links and pictures.
for the loop, is it:
do{
...//all the stuff//
}while (option == JOptionPane.YES_OPTION) ?(I think I have to parse, looking for "img src" and "a href", anyway)
The biggest thing I'm getting hung up about is where to start. All it'll do is ask for the URL, say there is an error, and ask if I want to do it again. Don't know how to make it loop again. Like I said, I think it's a do while loop but am not completely sure where it goes and how to have it work on the entire thing with message dialoge boxes
To ask for the input, I was trying to make the dialoge box a string so the string would be displayed and have the links extracted
String linkString=
JOptionPane.showInputDialog("Please enter a URL:");...but it obviously doesn't work like that...
Here is the whole mess so far...I don't know what my question is because I know what I want, just not the terms to ask. help?
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import javax.swing.JOptionPane;
public class WebPageExaminer
public static void main(String[] args)
String linkString=
JOptionPane.showInputDialog("Please enter a URL:");
String link = null;
URL url;
URLConnection urlC;
InputStream inStream;
InputStreamReader inStreamReader;
BufferedReader reader;
try
url = new URL(link);
urlC = url.openConnection();
inStream = urlC.getInputStream();
inStreamReader = new InputStreamReader(inStream);
reader = new BufferedReader(inStreamReader);
String inputLine = reader.readLine();
while (inputLine != null)
System.out.println(inputLine);
inputLine = reader.readLine();
catch(Exception e)
JOptionPane.showMessageDialog(null, "Error reading from file");
} int answer = JOptionPane.showConfirmDialog(null, "Examine Another URL?", "Click Yes or NO:", JOptionPane.YES_NO_OPTION);
if (answer == JOptionPane.NO_OPTION)
System.out.println("Goodbye");
System.exit(0);
if (answer == JOptionPane.YES_OPTION)
System.out.println("OK!");
}Edited by: digital.tradecraft on Mar 14, 2009 1:27 PMYou posted the questions 20 minutes ago? Why are you bumping it. People answer questions when they know the answer.
I tend to ignore people who expect an immediate answer. -
I need help with this? - Urgent!!!
Hello,
I am a beginner with Java, and C++. how can I parse the veritical bar? Could someone help me with this program please? It's due really soon
TABLE:STUDENT
| name | sid | class | degree |
| ABC | 001 | SR | BS |
| AAA | 002 | FR | BS |
| BBBB | 050 | JR | BS |
| CC | 033 | CL | MS |
| ZZZZ | 201 | SO | BS |
TABLE:COURSE
| cname | cnum | prof | hrs |
| DBMS | 157A | YAKLUR | 3.0 |
| DS | 146 | PPP | 4.0 |
Assignment 01 Due September 10th. (20 points)
Write a program which will parse the above text file with
tables and allow the user to select a table among the two
and one or multiple columns of that table with a condition
where the condition will be on a column with = or < or >.
Example:
SELECT (* or column name): name
FROM (type a table name): STUDENT
WHERE (give a condition ): degree = BS
output:
name
ABC
AAA
BBBB
ZZZZPosts like this really get to me....
I wasnt as fortunate as some and never had the opurtunity to go to school.. Instead I stayed up long hours reading away and learning to things on my own..
being new to java is not an excuse to be lazy, and reliance on others to solve your problems will get you nowhere fast..... -
I have an assignment that involves using Java to parse the info on one text file and output to another text file with a header row and a data row both of which need to be tab delimited. I'm relatively new to Java and I'm having a hard time even starting this thing. Any help would be greatly appreciated. The file I have to read from is similar to this:
Report: Fake Report for Fake Loans
Report ID: 000001
Run Date: 04/25/2007
Office Number ID Number DelqMessage
033 000101000 N
034 001234875 Y
035 123456789 N
I would essentially need to get all the field names into the header row and the data in the row below it.
Thanks in advance.I have been working on this and I almost have it working correctly. I was able to selectively pull the info I need from the original file and I can output to the new file in a vertical form. The last step is to output a header that says RunDate Office Loan DelqMessage with a tab delimiter. I than have to compile the data and output in rows under the header also in tab delimited format. I think I'm right there but I still get one error I cannot resolve of:
Error: java.lang.StringIndexOutOfBoundsException: String index out of range: 4
It is very vague and I have tried everything I can think of to locate the issue so it can be debugged. Below is a copy of the file I'm trying to parse followed by what I have for code so far. Any help would be greatly appreciated.
Sample of report:
Report: Fake Report for Fake Loans
Report ID: 000001
Run Date: 04/25/2007
ASC Number Loan ID DelqMessage
033 000101000 N
034 001234875 Y
035 123456789 N
ASC Number Loan ID DelqMessage
036 741258963 N
037 872563987 N
038 987521455 Y
======================================================================
Fake Report Summary:
ASC Total: 6
Loan Total: 6
Total Delq: 2
Code:
import java.io.FileReader;
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.IOException;
public class ParseFile {
public static void main(String[] args) throws IOException {
// Variable Declaration
boolean procOn;
String RunDate = "";
BufferedReader inputStream = null;
PrintWriter outputStream = null;
// Following block of code parses FakeReportToParse.txt and outputs
// needed portions of the report to characteroutput.txt
try {
procOn=false;
inputStream =
new BufferedReader(new FileReader("FakeReportToParse.txt"));
outputStream =
new PrintWriter(new FileWriter("characteroutput.txt"));
String l;
while ((l = inputStream.readLine()) != null) {
outputStream.println("Rundate\tASCNumber\tLoan\tDelqMessage");
if (l.indexOf("Run Date:")>=0) {
RunDate = l.substring(10);
outputStream.println(RunDate);
// Processing of report data
if(l.indexOf("ASC Number Loan ID") >= 0) {
procOn = true;
if(l.indexOf("-------------------------") >= 0 || l.indexOf("===============================") >= 0) {
procOn = false;
// Output report data to new characteroutput.txt file
if(procOn) {
String ASC = l.substring(0, 4).trim();
String LoanID = l.substring(15, 25).trim();
String DelqM = l.substring(30).trim();
outputStream.println(RunDate + "\t" + ASC + "\t" + LoanID + "\t" + DelqM);
catch(Exception z){
System.out.println("Error: " + z.toString());
} -
Please: HELP with iMIX. Urgent !
Dear all
I tried to find an apple.com eMail to ask this help without be successful.
Please I hope you can help me.
Well: I did an iMix including 7 songs on the list. I followed exactly all the iTune instructions.
BUT when I published this list, it results ONLY the last song !!!!!!
It' strange because all the songs, are published on iTunes ( search "Tiziano Demaria" on iTunes Store as author, and you will find my CD Karen. Those are the songs !! )
I want to delete this iMix because with only one song it's simply a ******** !
Please could you tell me:
- In what manner to delete it
- In what manner to be able to have in the iMix ALL the songs that I chosen ?
I'm really sorry if I ask to you but it's very dramatic to have not support from Apple about those issues !
Thank you very much in advanceIssue Solved.
In the Account settings is possible to delete the iTunes' iMix.
Titles were not present due several mistakes in the titling of the CD published on iTunes itself. Solved with TuneCore.com directly -
PROCEDURE Mktg_Obj_Cmpgn(p_attr_tbl_nm IN attr.attr_tbl_nm%TYPE,p_actn_cd IN chg_log.actn_cd%TYPE) IS
v_tbl_nm varchar2(100);
v_actn_cd varchar2(4);
BEGIN
v_tbl_nm := p_attr_tbl_nm;
v_actn_cd := p_actn_cd;
--dbms_output.put_line(v_tbl_nm);
IF v_actn_cd = 'CRET' THEN
SELECT to_clob(XMLELEMENT("requestmessage",XMLATTRIBUTES(xmlforest(
seq_pblsh_rqst.nextval AS "publish_id")),
XMLAGG(XMLELEMENT("campaign",XMLATTRIBUTES(XMLFOREST(chg.actn_cd AS "ACTION",
pgm.program_idseq AS "parententityvalue",
ent_sbsrb.ENT_ID AS "entid",
pgm.campaign_idseq AS "campaignid",
bus_unt.portfolio_subtype_id AS "campaignsegment",
pgm_typ.pgm_type_nm AS "campaigntype",
LKP.lookup_key_desc AS "campaignclass",
pgm.editor_userid AS "campaignlastmodifiedby",
pgm.edited_dtm AS "campaignlastmodifieddate",
pgm.mkt_initv_proc_tx AS "campaignlink",
ofr.offer_idseq AS "offerlink")))),
XMLAGG(XMLELEMENT("PROCESSCODE", XMLATTRIBUTES(XMLFOREST(action as "link",PROGRAM.program_idseq AS "parententityvalue",
ENT_SBSRB_ATTR.ent_id AS "entid"))))))AS "v_clob" into v_clob1
FROM dual,
chg_log chg,
program pgm,
ent_sbsrb_attr ent_sbsrb,
business_unit bus_unt,
program_type pgm_typ,
offer ofr,
(SELECT lookup_keyword,lookup_key_desc,lookup_type
FROM lookup_key
WHERE lookup_type = 'PRTFL_CMPGN_ID')LKP
WHERE chg.attr_id = ent_sbsrb.attr_id
and chg.parnt_ent_val_tx = to_char(pgm.program_idseq)
and pgm.business_unit_idseq = bus_unt.business_unit_idseq
and pgm.pgm_type_cd = pgm_typ.pgm_type_cd
and ofr.program_idseq = pgm.program_idseq
and pgm.pgm_cls_cd(+) = LKP.lookup_keyword;
END IF;
end Mktg_Obj_Cmpgn;
I have this procedure within a package. v_clob1 is declared in packagebody as a CLOB variable. when i try to compile it i am getting the below given error.can anyone please help me?
(1): PL/SQL: ORA-19208: parameter 1 of function XMLELEMENT must be aliased
(2): PL/SQL: SQL Statement ignoredhi sir,
wanna ask u guyz one query
let say i have table name account(parent) and service(child)
account
id name status
1 john 0
2 ki 1
3 kdf 2
service
id trans_id name status
1 1 et 9999
1 2 eee 2222
2 3 ere 999
2 4 wew 0
i plan to use something like this
delete account from account t1,service t2 where t1id=t2.id and t1.status<>0;
but sql command not correct so plz help me
now i need a query to delete records from service table only but
account.status <> 0 and accound.id=service.id
i dunt want to delete record from account table
so can u help me with this query
thanks
Message was edited by:
mani_um -
Need help with dates please-urgent
Hi folks, please help me with this if you can.
I run a weekly job, and need to have my java code create and use 2 dates to capture data for the whole week.
begin_date mm/dd/yyyy (String) to be 7 days prior to current date
end_date mm/dd/yyyy (String) to be the currecnt date
Note: please take into account the cases where the CURRENT_DATE is the first week of the month. As a result the 7 days prior will fall into the previous month. i.e if end_date="06/04/2003" then the begin_date will be "05/29/2003 Thanks a bunchhttp://java.sun.com/j2se/1.4.1/docs/api/index.html
See the Calendar and DateFormat classes. -
Help with Emoticon buttons, Urgent!!!
Hi,
I'm writing a Chat Application and I want to add Emoticon, I did so by adding buttons but I don't know how to send the gif to my JTextField and to my JTextArea.
Here is part of my code can someone can help me PLEASE!!!
JPanel chatPane = new JPanel(new BorderLayout());
JPanel emoticon = new JPanel(new GridLayout(2, 5));
b1 = new JButton (sourrire);
b1.setToolTipText("Un Sourire");
// b1.addActionListener();
emoticon.add(b1);
b2 = new JButton (gsourrire);
b2.setToolTipText("Un Grand Sourire");
// b2.addActionListener();
emoticon.add(b2);
b3 = new JButton (triste);
b3.setToolTipText("Triste");
// b3.addActionListener();
emoticon.add(b3);
b4 = new JButton (grimace);
b4.setToolTipText("Grimace");
// b4.addActionListener();
emoticon.add(b4);
b5 = new JButton (pleure);
b5.setToolTipText("Pleure");
// b5.addActionListener();
emoticon.add(b5);
b6 = new JButton (bec);
b6.setToolTipText("Un bec");
// b6.addActionListener();
emoticon.add(b6);
b7 = new JButton (coeur);
b7.setToolTipText("Un coeur pour toi");
// b7.addActionListener();
emoticon.add(b7);
b8 = new JButton (fache);
b8.setToolTipText("Fache");
// b8.addActionListener();
emoticon.add(b8);
b9 = new JButton (lunettes);
b9.setToolTipText("Je suis Cool");
// b9.addActionListener();
emoticon.add(b9);
b10 = new JButton (clinoeil);
b10.setToolTipText("Clin d'Oeil");
//b10.addActionListener(new ActionAdapter2());
emoticon.add(b10);
Thanks a lot!
Isabelleyoue can't do it on a textfield. Play with this;-import javax.swing.*;
import javax.swing.text.*;
import java.awt.Color;
public class MultiColouredText extends JFrame {
public MultiColouredText() {
StyledDocument doc = new DefaultStyledDocument();
JTextPane pane = new JTextPane(doc);
pane.setEditable(false);
pane.setFont(new java.awt.Font("Verdana", 0 , 16));
MutableAttributeSet mas = new SimpleAttributeSet();
try {
StyleConstants.setForeground(mas, Color.yellow);
StyleConstants.setBackground(mas, Color.blue);
doc.insertString(doc.getLength(), " Hello ", mas);
StyleConstants.setForeground(mas, Color.blue);
StyleConstants.setBackground(mas, Color.yellow);
doc.insertString(doc.getLength(), " World ", mas);
StyleConstants.setForeground(mas, Color.red);
StyleConstants.setBackground(mas, Color.green);
doc.insertString(doc.getLength(), " And ", mas);
StyleConstants.setForeground(mas, Color.green);
StyleConstants.setBackground(mas, Color.red);
doc.insertString(doc.getLength(), " Farewell", mas);
catch (Exception ignore) {}
getContentPane().add(pane);
setSize(245,56);
show();
public static void main(String[] args) {
new MultiColouredText();
}
Maybe you are looking for
-
Help with Resolution/Document Raster Effects
I am wanting to upload my logo to my credit card company to put on the face of my new card. obviously this will be small in size (1.5"x3") but the cc company requires the upload be at least 400pixels x 400pixels. I don't want to upload a 13"x6" becau
-
How to move the custom hooks in /etc/rc.d/functions.d to systemd
I have a few scripts placed in /etc/rc.d/functions.d that were launched during the boot process. Now I moved to systemd but I have not found any documentation about how to implement those hooks in the new boot process. As far as I got I need to write
-
How to engage the "today´s date" in works?
how to engage the "today´s date" in works?
-
Using Oracle Wallet for Java connection
Hi, Can anyone tell me how to acces the Oracle wallet from my Java application without using the thin or oci drivers?
-
In a photo of text: can I highlight or underline?
I have a photo of a page from a book and I need to highlight a few words.