Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

prithaa

@prithaa
About
Posts
586
Topics
257
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Database Connection from Java
    P prithaa

    Hello, I am trying to connect to mysql from Java with the following but getting this error Exception in thread "main" Communications link failure

    package testPackage;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.util.Properties;

    public class Main {

    public static void main(String\[\] args) throws Exception {
    	// TODO Auto-generated method stub
    			  
    	    try {
    	      Class.forName("com.mysql.jdbc.Driver");
    	      Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/student?useSSL=true","root","success");  
    	      System.out.print("Database is connected !");
    		  con.close();				
    }
    	    catch(Exception e)
    	    {
    	    	System.out.println(e.getMessage());
    	    	throw e;
    	    }
    	    	
    	    }
    

    }

    Java database java mysql com help

  • tomcat and eclipse
    P prithaa

    Hello, I have installed tomcat 6 with eclipse but now i want to install tomcat 7 with eclipse . But I keep getting the error The Apache Tomcat installation at this directory is version 6. A tomcat 7 installation is expected. Any idea how should i go about it. Pritha

    Java apache help announcement

  • How to create/set an element of a document
    P prithaa

    hello thanks for your reply I am using swing libraries and there i am able to create a leaf or a branch of a document but the leafelement doesnt seem to get added to the default root .

    public class MyDoc extends DefaultStyledDocument {

    protected void insertUpdate(AbstractDocument.DefaultDocumentEvent e,
    AttributeSet attr){
    Element root = getDefaultRootElement();
    Element branchroot = new BranchElement(root, null);
    branchroot = createBranchElement(root,null);
    Element leafElement = new LeafElement(branchroot, null, 0,0);
    leafElement = createLeafElement(branchroot,null,"p");
    }

    public Element createBranchElement(Element parent,AttributeSet a)
    {
    return super.createBranchElement(parent, a);
    }

    protected Element createLeafElement(Element parent,AttributeSet a, String arg) throws BadLocationException
    {
    return super.createLeafElement(parent, null, startOffset(arg),startOffset(arg)+5);
    //complete code createleaf not written
    }

    }

    Java tutorial question

  • How to create/set an element of a document
    P prithaa

    Hello, I have a code like this

    public class Doc extends DefaultStyledDocument{
    }

    Doc doc= new Doc();
    doc.insertString(0, "This is a working document", null);
    AbstractDocument.AbstractElement rootElement = doc.createDefaultRoot();

    Once I create a root element how do I assign or set its value from the doc string.Currently the element is blank. thnaks Pritha

    Java tutorial question

  • using jxl to write formula in excel
    P prithaa

    thanks for ur reply I tried that but it doesnt work and surprisingly

    buf.append("SUM(A1:a4)");

    works fine then why

    buf.append("MDETERM(A1:D4)");

    should have a problem

    Java java help

  • using jxl to write formula in excel
    P prithaa

    Hello, I want to write a formula in excel through java but when I do the following a formula is displayed in the cell without displaying the results.The error with the formula is also seen.'A value used in the formula is of wrong data type' but the above error disappears if I reenter the same formula for the same data.I am using the following code to do with jxl libraries.

    StringBuffer buf = new StringBuffer();
    buf.append("MDETERM(A1:D4)");
    Formula f = new Formula(0, 11, buf.toString());

    Pritha

    Java java help

  • to open an excel file and write
    P prithaa

    Thankyou Richard for your help

    Java

  • to open an excel file and write
    P prithaa

    thanks for replying

    Workbook workbook = Workbook.getWorkbook(new File("d:/Writefile.xls"));
    WritableWorkbook copy = Workbook.createWorkbook(new File("d:/Writefile1.xls"), workbook);
    copy.write();
    WritableSheet sheet = copy.getSheet("Report2");
    Number number;
    number = new Number(0, 0, 453.25, times);
    sheet.addCell(number);
    copy.write();
    copy.close();

    I want to open an existing file and add a cell to an existing sheet. The above code opens the file but the cell editing doesnt happen. Regards pritha

    Java

  • to open an excel file and write
    P prithaa

    yes i did read the link u sent and looked at the class writablework but there is no method which opens an existing .xls file Regards Pritha

    Java

  • to open an excel file and write
    P prithaa

    thanks for the article but i cant still open a writableworkbook .i can write on a new

    workbook

    but cant write on an existing workbook I didnt find any method doing that either in writableworkbook regards Pritha

    Java

  • to open an excel file and write
    P prithaa

    thanks Richard but a

    WritableWorkbook creates a new workbook and has no method which opens a workbook

    Pritha

    Java

  • to open an excel file and write
    P prithaa

    thanks but the above link is not opening my problem was the following

    InputStream inp = new FileInputStream("d:/Writefile.xls");
    WorkbookSettings ws = new WorkbookSettings();
    Workbook wb = Workbook.getWorkbook(inp, ws);
    Sheet sheet = wb.getSheet(0);
    //Cell cells[] = sheet.getRow(0);
    //Cell cell = cells[0];
    //String cellContents = cell.getContents();
    //Modify the cellContents here
    //Write the output to a file
    Number number;
    number = new Number(0, 0, 453.25, times);
    ((WritableSheet) sheet).addCell(number);
    wb.close();

    The above code doesnt add the cell to the given file just opens the file.I get DispatchUnCaughtException for the line

    ((WritableSheet) sheet).addCell(number);

    Thanks for the reply Pritha

    Java

  • to open an excel file and write
    P prithaa

    Hello Is there an article to open an excel file and write through jxl files. Every time I try to write into excel file a new file is created instead of opening the old file. Pritha

    Java

  • iterator problem
    P prithaa

    thanks

    Java database help question

  • iterator problem
    P prithaa

    thanks for the reply check the runtime what does it mean ?

    Java database help question

  • iterator problem
    P prithaa

    thanks for your reply it doesnt throw an exception. The problem is it works on one system and doesnt work on another. should i reinstall eclipse or java libraries. thanks

    Java database help question

  • iterator problem
    P prithaa

    List<OrderedPair> list1 = new ArrayList<OrderedPair>() ;

    	OrderedPair e0  = new OrderedPair(); e0.index=0; e0.value=1;
    	OrderedPair e1  = new OrderedPair(); e1.index=2; e1.value=2;
    	OrderedPair e2  = new OrderedPair(); e2.index=3; e2.value=3;
    	
    	ListIterator<OrderedPair> iterator = list1.listIterator();
    	iterator.add(e0);
    	iterator.add(e1);
    	iterator.add(e2);
    	
    	OrderedPair op1 = (OrderedPair) iterator.previous();
    	System.out.print("index = "); System.out.print(op1.index);
    	System.out.print(", value = "); System.out.print(op1.value);
    	System.out.println();		
    	
    	OrderedPair op2 = (OrderedPair) iterator.previous();
    	System.out.print("index = "); System.out.print(op2.index);
    	System.out.print(", value = "); System.out.print(op2.value);
    	System.out.println();	
    	
    	OrderedPair op3 = (OrderedPair) iterator.previous();
    	System.out.print("index = "); System.out.print(op3.index);
    	System.out.print(", value = "); System.out.print(op3.value);
    	System.out.println();		
    

    Above is the code block which works fine on one system but the previous() method on some other system doesnt move the iterator backwards and results in the same object . Any idea why such a behaviour? Pritha

    Java database help question

  • iterators
    P prithaa

    thank you for your valuable insight

    Java help

  • iterators
    P prithaa

    Hello when I pass iterator as a parameter why is it that the cursor position changes without me giving any instructions about iterator.next() or iterator.previous() any good article regarding iterators I need to read will be of great help especially passing as parameters PRitha

    Java help

  • iterator previous() add()
    P prithaa

    thank you for a wonderful explanation

    Java tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups