private 2D array

Hello,

I'm quite new to Java but am trying to build a website that uses SQL queries to perform user requests.

I'm trying to make a function that executes "select" type SQL queries (from a String paramater, 'qry') then executes it storing the results in a private 2D array in a tabular format.

Does anyone know how I can do this? I have imported the java.sql* library into the page and have already set up a connection and declared resultsets and so on...

Any help gratefully appreciated!

[522 byte] By [frogger989a] at [2007-11-26 21:43:28]
# 1

It sounds pretty straightforward to me. I know I probably wouldn't have thought so when I was a beginner myself, but there are plenty of examples of how to execute SQL select statements from within Java out there, and also some examples of using 2D arrays. Read something, and if you still have a question, please be more specific about it.

OleVVa at 2007-7-10 3:30:27 > top of Java-index,Java Essentials,Java Programming...
# 2

I read through this site which seems to do pretty much what I am after:

http://forum.java.sun.com/thread.jspa?threadID=615738&messageID=3872564

However, the example shows this working with 3 String parameters (that each go to make up an SQL statement) where as I just have one parameter, 'sql'.

I just cant get it to produce the 2D array for the results of this sql statement. The array needs to be interlaced with HTML table coding (<td><tr></tr><td>...) so that when the function is called from the main web page, the array is displayed as if it were a table.

I hope this makes sense, thanks for your help!!

frogger989a at 2007-7-10 3:30:27 > top of Java-index,Java Essentials,Java Programming...
# 3
does anyone have any ideas? I still can't find a solution...
frogger989a at 2007-7-10 3:30:27 > top of Java-index,Java Essentials,Java Programming...
# 4
Search for getArray(), it might help: http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/JDBC20.html
kevjavaa at 2007-7-10 3:30:27 > top of Java-index,Java Essentials,Java Programming...
# 5
Do you know how you're making the connection between HTML and Java? A servlet? JSP? This pretty much decides who shold be the next "expert" to throw in a word -- or really, in which forum you should ask your question.
OleVVa at 2007-7-10 3:30:28 > top of Java-index,Java Essentials,Java Programming...