Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Exporting recordset to xls spreadsheet

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Exporting recordset to xls spreadsheet

    I'm using Netbeans to create db application. I need to export the results of a query (recordset) into an excel file.
    How can I do that?
    Here is how I create the recordset:

    String host = "jdbc:derby://localhost:1527/TownHall";
            String uName = "test";
            String uPass= "111";
            try{
            Connection con = DriverManager.getConnection( host, uName, uPass );
            Statement stmt = con.createStatement( );
            String SQL = "SELECT * FROM TAXES";
            ResultSet rs = stmt.executeQuery( SQL );


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Exporting recordset to xls spreadsheet

    Read through this JExcelApi

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,337
    Thanks
    182
    Thanked 830 Times in 773 Posts
    Blog Entries
    5

    Default Re: Exporting recordset to xls spreadsheet


  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,337
    Thanks
    182
    Thanked 830 Times in 773 Posts
    Blog Entries
    5

    Default Re: Exporting recordset to xls spreadsheet

    This thread has been cross posted here:

    http://www.java-forums.org/jdbc/56389-exporting-recordset-xls-spreadsheet.html

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting


  5. #5
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Exporting recordset to xls spreadsheet

    Quote Originally Posted by copeg View Post
    I'm not able to find the relevant POI jar file. Any help?

Similar Threads

  1. Exporting Runnable JAR File
    By cr80expert5 in forum Object Oriented Programming
    Replies: 3
    Last Post: January 26th, 2012, 08:35 PM
  2. Exporting to an Excutable Jar
    By KeyLay in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 28th, 2011, 06:21 PM
  3. JCheckBox and sql recordset
    By bczm8703 in forum JDBC & Databases
    Replies: 1
    Last Post: October 23rd, 2011, 10:30 AM
  4. Exporting Data to Excel Spreadsheet
    By PineAppleKing in forum Java Theory & Questions
    Replies: 5
    Last Post: May 19th, 2011, 03:03 PM
  5. Replies: 1
    Last Post: April 21st, 2011, 09:59 AM