• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

SQL to Java array

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am wanting to take several large databases from an SQL server and put them in arrays in my Java code. I know I will use java.sql.* but i dont know how I would go about pulling the info and putting it in.
 
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Search google for a JDBC tutorial.
[ June 20, 2005: Message edited by: Bill Rushmore ]
 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what about taking a string of:

Ball|Red|soccer|Yes

that exists in a Vector row and taking all the values and putting it into a Vector with seperate colums.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've had success using the ResultSet class in java.sql. in the API specs on the java.sun page there are some examples and what not.

basicly what you do is
in psudo code*
// set Result rs = statemant.executeQuerry("SQL Querry");
//rs.next() will let you go through the rows
//String s = rs.getString(columnNo.);

that's a really simple and ugly overview, but once you start looking at the Java docs on http://java.sun.com/reference/api/index.html you'll get the idea on what to do.

John Martinson
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic