Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

sampath kumar yanagandla

Greenhorn
+ Follow
since Apr 29, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sampath kumar yanagandla

hi,
what is the default package for a java program.

if we mention

it belongs to javaranch package.

what package it belongs to if we dont mention package name.
14 years ago
hello every body,
i have problem with jdeveloper ide,
when i am trying to run a single file in my application it is compiling every file in the application.where can i change settings inorder to avoid compilation when trying to run individual file
I want to design a utility class to get values of elements and attributes of xml document which parser can i choose???
thanks in advance
hi..
i also have the same problem is anybody got the solution
14 years ago
can any one tell me about
1.how to insert a xml message in body of soap message.
2.how to write soap message object in xml file.
14 years ago
hi..
im new to SOAP..following is my code



here iam getting exception

javax.xml.soap.SOAPException: Could not get document from SOAPEnvelope
at org.apache.axis.SOAPPart.getContent(SOAPPart.java:896)
at test.SoapToXml.toDocument(SoapToXml.java:21)
at test.SoapMsg2.main(SoapMsg2.java:38)
Caused by: org.xml.sax.SAXException: Fatal Error: URI=null Line=1: Next character must be "=" after attribute name "Header".
at org.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.java:723)
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3038)
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3029)
at org.apache.crimson.parser.Parser2.nextChar(Parser2.java:2951)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1372)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:179)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:369)
at org.apache.axis.message.MessageElement.getAsDocument(MessageElement.java:1082)
at org.apache.axis.SOAPPart.getContent(SOAPPart.java:894)
... 2 more
Process exited with exit code 0.
14 years ago
this is the exception tree

"java.lang.ClassCastException: java.util.Collections$SynchronizedRandomAccessList
at javax.swing.table.DefaultTableModel.justifyRows(DefaultTableModel.java:242)
at javax.swing.table.DefaultTableModel.setDataVector(DefaultTableModel.java:198)
at javax.swing.table.DefaultTableModel.<init>(DefaultTableModel.java:133)
at javax.swing.JTable.<init>(JTable.java:451)
at test.Jtabinsertion.main(Jtabinsertion.java:50)"

but why it is giving error at JTable constructor???
14 years ago
thanks for your reply
i got
"java.lang.ClassCastException: java.util.Collections$SynchronizedRandomAccessList"
exception
don't know where exactly it's wrong.
14 years ago
import java.awt.List;

import java.sql.*;
import java.net.*;

import java.util.ArrayList;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JTable;
public class Jtabinsertion {
public static void main(String[] args){
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection("jdbc racle:thin:@172.16.40.4:1521:hpsipos","commorm","commorm");
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select * from pty_im where rownum<3");
JTable jtb=null;
Vector columnnames=new Vector();
columnnames.addElement("pty_cd");
columnnames.addElement("csnr_flg");
Vector rownames=new Vector();
Vector rowdata=new Vector();
//ArrayList rowdata=new ArrayList();
int i=0;
int pre=0,post=0;


while(rs.next()){
if(i<3)
{
rownames.addElement(rs.getString("pty_cd"));
rownames.addElement(rs.getString("csnr_flg"));
post=rownames.lastIndexOf(rownames.lastElement())+1;
System.out.println("pre:"+pre);
System.out.println("post:"+post);
rowdata.add(rownames.subList(pre,post));
//System.out.println(rownames.toString());
pre=post;
i++;
}
}




//System.out.println(rowdata.toString());
jtb=new JTable(rowdata,columnnames);
JFrame jf=new JFrame();
jf.add(jtb);
jf.pack();
jf.setVisible(true);
/*System.out.println(rs.getString("pty_cd"));
System.out.println(rs.getString("csnr_flg"));
System.out.println(rownames.elementAt(1));*/
// System.out.println(rowdata.toString());
}



catch(Exception e){
System.out.println(e);
}
}
}
14 years ago
hi frnds,
today i cleared scjp1.5 with 95%.
15 years ago
I got it..
Thanks for the explanation.
Collection<?> c=new ArrayList<String>();

we cannot add anything to c.Then what is the use of referring object to c??
why is it ambiguous if we pass null to append method??