Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Write an array to a file, via a recursive sql-statement

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. First I must excuse myself. I'm a totally new beginner in Java, and could really need some help about an idea I have got. I want to retrieve some data from a table with a recursive sql-statement. Then the retrieved data are to be written to a .js-file. The catch is that the data has to be represented in an array with array's ( the structure of the .js-file have to be an array with arrays). Does anybody have an idea of how to put that kind of code together in an easy way? Thanks for helping me out. I guess I just need an example to really get started on this.
------------------
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will probably find more help for SQL problems in the JDBC forum. A rough overview of how I would go about this would be as follows:

  1. Create a JDBC connection to my datasource

  2. Execute a SQL Statement and capture the result in a ResultSet

  3. Step through the ResultSet using the next() method inside of a loop

  4. On each pass, write out one line of my .js file


  5. HTH
    [This message has been edited by Bodie Minster (edited May 02, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic