Converting a ResultSet to a Vector

hiya i gota question...(my code is below)...im doing a search query which searches the database for the search field and then these gets the results into a ResultSet.
i then need to print these out in a table kinda thing but at the moment the results are bunched together. this is a problem cos the <A HREF> link is highlighting all the results whereas each result needs to be linked to another page.
THEREFORE i think i need to convert the resultset to a vector and then print out the vector one by one onto the jsp page.
Enumeration enum = v.elements();
while(enum.hasMoreElements()) {
String s = (String) enum.nextElement();
query = "SELECT * FROM Login_Details LD, Personal_Details PD, Education E, Work_Experience WE, Skills S WHERE
LD.Email_Address = PD.Email_Address AND LD.Email_Address = E.Email_Address AND LD.Email_Address = WE.Email_Address AND
LD.Email_Address = S.Email_Address AND PD.Surname = '" + s + "'";
ResultSet rs = st.executeQuery(query);
while(rs.next()) {
%>
<%out.println(rs.getString("Surname")); out.println(", "); out.println(rs.getString("Forename"));%>
<%
any ideas ???
thanks

Hi
Try this
<TABLE border=1>
<%
     while(rs.next()){%>
<TR>
     <TD>
     <%=rs.getString("Surname")+" "+rs.getString("Forename")%>
     </TD>
</TR>
     <%}%>
</TABLE>
Mars Amutha

Similar Messages

  • Converting the resultset to an arraylist

    In my application, I was successful in getting connectivity with the Oracle db and successfully queried it.
    I checked out that the ResultSet displayed correct values.
    Can I convert this ResultSet into some say ArrayList or something so that it remains with me thoughout the execution of the program? I mean I will have to query the database many times, so this ResultSet will need to be closed.
    Is there a problem if copy it into another ResultSet object and dont close it ?

    Google Pagination, or possibly better, if it all takes place within a single application, is to design a class for this "query" that preforms the query when initialized, then keeps the ResultSet open until some other part of the program calls some method on the class to close everything up, and use access methods to return specific parts of the data from the query.
    i.e.
    public class Bogus {
      private Connection conn;
      private Statment stmt;
      private ResultSet rs;
      public Bogus () {
        //open conn, perform query, assign rs
      public Object[] getRow() {
        // assign elements in Row to an Object[] and return it
      public void cleanup () {
        //close the rs, stmt, and conn
    }Then pass around the reference to this object.

  • Storing resultset data to vector and then passing this data to JList

    hi every body I am facing this problem since two days I tried but could't get correctly,I am new to java and I need to pass the result set data from the database to a JList having JCheckBox
    I think I need to store the resulsetdata to a vector or array
    I tried but could't solve the problem
    I tried but could't get it
    please do help me out
    need some sample code for passing resultset data to JList having JCheckBox anybody please help me out
    thanking you,
    with regards

    hi guys any body please help me out
    need a sample code for the first thread which i had the problems
    trying but could't get that correctly,please please do help me out,
    do help me out as I am new to java need some code snippet java gurus
    thanking you,
    with regards

  • How do I convert full color (or black) vector art to a single color?

    Im sure there is an easier way but I have some vector clipart that I need to convert to a single non-black color. Some of it is coming as full color, others are coming as black.  I need to convert them to a particular PMS color.  Im sure there is an easier way than clicking on each individual vector and doing it manually...correct?

    In your swatches palette, select your destination color, and choose new color group (you have to do this 1st step for this to work)
    Edit >> colors  >> Recolor Artwork
    Choose preset 1 color job, then choose the color group which has one pantone.
    Converted but obviously placed images in this example. But the colors are GLOBAL so this is a great solution!!!

  • How do I convert color image to color vector?

    Hi,
    Im fairly new/not very well versed in Illustrator, I was wondering if you guys could help me with instructions or tips how to convert old alphabet art to color and actualy converting color images like drawings to vector . Ive tried image trace but it turns the image black and white and with really rough strokes.
    Thank you!

    Is this art in the Public Domain? Or, do you have the copyright owner's permission to use it in your work? If the answer to both of these questions is no, then you should not be using it.
    That being said, I got good results with image trace (using the High Fidelity Photo preset) even on the low-res image you attached here. You just have to adjust the preferences after you do the trace.

  • Help converting raster product image to vector

    I have an image of one of our products that I need to convert to a vector image for the use in a video.  I'm not too skilled in IA and everytime I try to use Live Trace (w/ various settings) the results are not ideal.  I've included a jpeg of the product.  I have a hi-res raw file to work with.  Can anyone provide me with advice on the best way to go about converting the image to vector?  Thank you in advance!
    Mel

    Sounds like a poorly defined project then. You need to nail down the client's requirements and expectations.
    If the requirements are simply for a scaleable 2D drawing, then a number of rendering methods will work. But if the animation envisioned calls for the cylindrical object to rotate (about any axis other than the line of sight), then doing that kind of frame-by-frame artwork in Illustrator will be inefficiently tedious.
    Illustrator's 3D Effect can extrude the semicircle or split circle section. And creating a Blend between two copies of a 3D Effect object with different orientations can achieve the series of frame-by-frame images. But it cannot do the notch as one extruded object. Nor can it extrude two separate paths in the same 3D coordinate system at different positions along the extrusion axis. Nor can it revolve two paths at different degrees in the same 3D space. Plus, its rendering of reflective metalic surfaces is not as versatile as would be required, so you'd have to resort to artwork maping, which would not likely be very convincing on a rotating object.
    So if the tube-like object is to spin, Illustrator is a poor choice of a program to use for it.
    JET

  • ResultSet to Array/Vector

    Does anyone have some code that read's data from a resultSet and puts it into a 3D array or Vector that I could look at? (3D array examples would be better).
    The code I have is giving me a few problems and I was wondering how other people have implemented the above.

    Try that buddy. this is similar taking it from an object and adding it to a vector and the only reason i am returning it cause i am using the vector in a jsp page...
    public Vector getRecordE(String ProjectID){
                   ResultSet TPRO_E=null;
                   try{
                   PreparedStatement P_TPRO=conOrcl.prepareStatement("select * from recorde where PROJ_EXT_PROJ_ID=?");
              //assign the ? to the argument passed
                   P_TPRO.setString(1,ProjectID);
              //execute the statement
                   P_TPRO.execute();
              //execute the query
                   TPRO_E= P_TPRO.executeQuery();
              //looping through the resultSet
              while (TPRO_E.next()){
              //create an instance of the class
                   JavaBeans ItemE = new JavaBeans();
              // set it to the Bean
                   ItemE.setTwinId(TPRO_E.getString("twin_proj_id"));
                   ItemE.setprojPhaseCode(TPRO_E.getString("proj_phase_cd"));
                   ItemE.setEfund_cd(TPRO_E.getString("fund_cd"));
              //add the object to the vector
         V_itemsE.addElement(ItemE);
              }catch(SQLException w){
                   System.out.println(w.getMessage());
              //returning the vector
                        return V_itemsE;
    hope it helps... pretty close

  • Converting byte arrary into a vector

    Hello Everyone,
    I need to convert a byte arrary into a vector. Can anyone tell me how this can be done??
    Thanks in advance!!!!!

    Tiger, tiger.... :o)
    Doesn't change the fact.From the programmers perspective it does.What she said.

  • Jdev11g: How to convert  Xml resultset   to a ADF DataControl

    How to convert a Xml Resulset from a webservice response (biee webservice) to a ADF Data Control?

    Please post JDeveloper 11 questions on the JDeveloper 11 forum:
    JDeveloper and OC4J 11g Technology Preview
    How about using the Web Service Data control for this?

  • How to convert all white - alpha for vector image?

    I'm attempting to make a new font. Currently I've been saving all the png -> vector images that I work with as .AI files, so that I can import them into my font program later, and they open fine in illustrator. The problem is, I usually save my vector images with a white background instead of alpha. Now, I need to replace white with alpha, but I can't find a magic wand in illustrator . Any help?

    function(){return A.apply(null,[this].concat($A(arguments)))}
    I only knew the most fundamental differences between raster and vector: that raster images are saved in dots while vector images are saved in, at the simpliest, lines.
    Not "dots";  pixels. Pixels are simply color values. That's all. Raster programs arrange color values in a rectangular grid of same-size rectangles (usually squares).
    Not "lines"; paths. Paths are discrete individual objects. Paths are stacked, independently moved, freely arranged, scaled, filled, stroked, and otherwise manipulated as individual objects.
    function(){return A.apply(null,[this].concat($A(arguments)))}
    But I'd have thought there was a way to quickly delete the white lines
    There is no "vector image" with a background. Where there are no objects, there is no "background." If a path is there, regardless of whether it has a white fill, a white stroke, or fill(s) and/or stroke(s) of any other color or no color at all, the path is there and can be deleted. (Again, there is no substitute for learning to use the program from the documentation.)
    Technically, paths are mathematically-defined curves. So even a "straight line" is a path, and is technically a curve. The specific kind of mathematically-defined curve used in programs like Illustrator is called a Bezier curve.
    function(){return A.apply(null,[this].concat($A(arguments)))}
    I have no idea how hard it is to create a vector image from scratch.
    It's not rocket science. Anyone can learn it. But again, you have to learn it. There is no substitute for learning to use the program from the documentation.
    function(){return A.apply(null,[this].concat($A(arguments)))}
    I myself am mostly a newbie in both hemispheres of the graphic design world.
    It shows. And there's certainly nothing wrong with that. We all started as beginners. I'm not trying to belittle you: I'm offering you sound advice that will serve as a very valuable shortcut to becoming more than a beginner (if you will accept it) without an unnecessary amount of fumbling around with bad practices.
    Just don't ever claim to a client or in a job interview to know anything at all about any mainstream general-purpose vector drawing program (of which Illustrator is just one) until you are proficient at drawing Bezier curves. That's prerequisite. It's lesson one in chapter one. Might as well start there. Start at the correct beginning and you'll know all the answers to the questions you have asked in this thread. Your understanding of "background" and things like why a region with no objects is not the same thing as an alpha channel in a raster image will come very early if you just start at the beginning. You've got to learn the lay of the land. Start at the beginning.
    function(){return A.apply(null,[this].concat($A(arguments)))}
    In any case, I use a program called vectormagic that does the work for me pretty well, so you might want to check it out.
    Trust me; I'm familiar with it. It's just another autotrace program. I know what it does. I know how "well" it does it. Everything I said in the previous post stands.
    Vector drawing programs are not the kind of program you learn by just launching it and poking around. Not if you want to avoid endless confusion and frustration. Asking random questions in an online user forum (in which wrong "answers" are just as common as right answers) everytime you encounter a point of confusion is just as inefficient. Read the documentation.
    JET

  • Converting a ResultSet to XML (mysql) - very slow - need some criticism

    Preface:
    I have some data being inserting into a mySQL table every 5 minutes. Currently, there are about 275 rows. Each row has 26 (TEXT) columns, the data in those columns is no longer than 10-15 characters.
    I am using the following code to turn this data into XML which is then, through a servlet, output on a webserver. With 275 rows, this is taking around 3-4 minutes to generate the XML file. I am worried that in a week from now when the data is over 2,000 rows it will exponentially decrease in speed. Can someone give me a better route so this will run faster?
             String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n";
           String SQLCommand = "select * from "+getDataId()+";";
           try{
                Statement stmt;     
                ResultSet rs;
               String url = "jdbc:mysql://"+getIBoxIp()+":"+getDbPort()+"/"+getDbName();          
               Connection con = DriverManager.getConnection(url,getDbUsername(), getDbPassword());                     
                    stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
                    rs = stmt.executeQuery(SQLCommand);
                    while(rs.next()){
                      xml += "\n<row>";
                      ResultSetMetaData md = rs.getMetaData();
                      for(int i = 1; i < md.getColumnCount() + 1; i++){
                           xml += "\n\t<" + md.getColumnName(i) + ">" + rs.getString(i) + "</" + md.getColumnName(i) + ">";
                      xml += "\n</row>\n";
                    System.out.println("@@mysql> XMLSQLCommand > " + SQLCommand);          
               con.close();     
               return xml;
           }catch(Exception ex)
                System.out.println("@@mysql> SQLCommand Failed > " + SQLCommand + "\n@@mysql> Exception > " + ex.getMessage() + "");
                return xml;
           }Again, with 275 rows, I'm getting about 250 KB of data in the resulting XML file with a 3-5 minute parsing/generation time.
    Thanks in advance!!!
    Edited by: bergy on Sep 21, 2007 8:46 AM added code tags

    No, it's a good question. The page I linked to does say
    "Instead of XMLWriter, this driver uses David Megginson�s other public domain writer program, DataWriter..."
    So yeah, trying to track down Megginson's code might not be such a good idea. But the sentence quoted does suggest what should be used instead: XMLWriter. Which implies that XMLWriter was mentioned somewhere earlier in the book.
    So, following the "Prev" links to previous pages, eventually I found XMLWriter discussed a couple of pages earlier, where it says
    "More specifically, I�m going to use David Megginson�s public domain com.megginson.sax.XMLWriter class."
    I don't really find this very satisfactory as advice for beginners, so I somewhat regret doing that. It's a long time since I looked at that page myself. But it does have a link pointing to http://www.megginson.com/downloads/, where it is possible to download the Java version of XMLWriter. I'm not sure if the OP is comfortable with using downloaded software, but that download is the simplest possible Java download so it might be a good place to start.
    You could recommend using a DOM strategy, and JDOM might be a good choice, but if you can just generate the XML straight from your input, it's a better strategy to do that rather than building a DOM tree in memory and then serializing it, in my opinion.

  • Convert my image into a vector type

    I'm trying to vectorize my image and Photoshop makes this hard, and im told AI is the better option,.
    I dont have the program and wasd wondering  if you can do it?
    Ill give you a virtual high five if you dio...
    Thanks

    I dont have the program and wasd wondering  if you can do it?
    Not unless there's some photos of some hot young guys posing in speedos in it... *lol* (yes, I'm a gay diva). As Scott said, asking to do work for free on a forum as this is not the best of ideas. If you really want it done free, I'm sure you can find better places like perhaps some person on DeviantArt not knowing what to do with his time and lending a hand. Still, even they will face the problem of having anything to work with - unless a much higher-res version exists somewhere in the 3000 pixels range, it basically means re-drawing things from scratch, not tracing. It might therefore be just simpler to find a suitable stock vector artwork and re-create your logo completely e.g. using the 30 day trial for Illustrator. Other than that tracing the origins of he logo back to its original creator would be advisable. This more or less simply looks like someone did just that - use a file from a stock/ clipart library and build the logo around it. Once you know what was used and the files are still available, it would be super-easy to re-crate this...
    Mylenium

  • Converting ResultSet to Multi Dim Array

    Can anyone tell me an easy way of converting a ResultSet to a Multi-Dimensional array
    Thanks Gary

    convert it to a vector of vectors
    then convert the vector of vectors to a 2 dimensional array (array of arrays).
    you should be able to get the code to convert a vector of
    vectors into a 2 dim array from the web site.

  • Can Vector contain ResultSet which is a Interface

    What i am trying is to execute 3 different SQL in a Bean and try it to transfer in a JSP.I am using Vector for this work.I am putting the ResultSet in the Vector and transfer that Vector to the Jsp,In which i am displaying the Result.
    I wanted to know that Is it possible to do the thing in this way.Or some other way is there.
    Could any one tell me the Solution.

    May be I 'm wrong, but the objets implementing the ResultSet interface
    must be serializable and have a public default constructor if you want
    to serialize/deserialize them. I don't think the most know drivers
    are offering you these features.
    Even if it's feasible, I don't think serializing a whole data set is
    really a good idea, because of the big overhead of doing this.
    You'd better convert the resultSet into smaller objects and
    only pass a set of them to your jsp only under request,
    not the whole thing once.
    Hope this helps

  • Need to convert to vector format.

    I have a document with pictures.  I need to convert it to vector format before sending to printer.  Not sure how to do it.  Using CS5.  Is converting to outlines the same? 

    It must be difficult to convert from illustrator into a vector format since no one has a specific answer.
    Soshagayle7,
    There is no automagic "conversion" from a raster image to a vector graphic. The artwork represented by a raster image can be redrawn as vector artwork.
    You can re-draw the artwork using the vector drawing tools in Illustrator or any similar program. You can even import the raster image and use it as a guide while "tracing" it with vector paths.
    Or (and this is where the all-too-common misconception about "conversion" comes in)...
    You can use the autotrace feature which exists in Illustrator or any similar program to try to automate the process of "tracing" the raster image with vector paths.
    Either way, you end up with what would more accurately be called a "reinterpretation" of the subject, not a "conversion" of the raster image in the sense of "converting" one file format to another.
    And that's the key. All that most current autotrace features (including the one in Illustrator) do is detect color differences between pixels of a raster image based upon a user-specified sensitivity setting, and then try to draw vector paths which follow along those detected differences. It's very much a garbage-in-garbage-out process.
    And even when the "in" is not garbage, there is no real intelligence involved. The kind of autotrace algorithms in Illustrator and programs like it have no shape-recognition intelligence. For example, in the case of a human face, the autotrace feature doesn't know that the eyes' pupils are round; it just detects a region of similarly-colored pixels and tries to draw a path around them. Similarly, in the case of a geometric logo that obvously (to a human) is supposed to contain a perfect circle, the autotrace feature doesn't "see a circle"; it doesn't go and get the Ellipse tool and draw a circle that fits, as any human would do. Again, it just tries to follow around the regions of similarly-colored pixels.
    But that sounds okay, right? Well think about it. Imagine turning the sensitivity of such an algorithm way up to the max. What's going to be the most accurate autotracing of a raster image? The mathematically "most accurate" result would be a perfect vector square for each and every pixel in the image. And the "vector advantage" of that would be absolutely nill. The resolution-independence reason for preferring vector paths would be rendered moot. Such a graphic would be entirely vector, but to absolutely no advantage regarding scaleability. (Thus my comment about the line drawn with a 1-pixel raster image.)
    So the reason you haven't received an answer to the "how do I convert" question is because the same thing has been explained in this forum countless times, and to answer it correctly really requires a lengthy explanation (like this one) that tries to clear up the too-common misconception that autotracing is some kind of magic bullet for "converting" a raster image into a vector graphic in some kind of mathematically accurate way that then yields all the advantages of properly drawn vector graphics.
    Autotracing is useful to those who understand when it's appropriate and why. But without seeing or at least knowing more about the actual raster image you are dealing with, advising whether it's appropriate in your case is nothing but a guess. Generally speaking, if the image in question is not already of high enough resolution at the size at which it will be printed, then it's probably also not of high enough resolution for good auto-tracing results. And if it is of sufficient resolution for the size at which it will be printed, then there's probably no reason it needs to be vector.
    Bottom line: There's a good reason why vector graphics are preferred. But that means properly-drawn vector graphics. The best way to "convert" your raster image to a vector graphic is to re-draw it using the vector tools. The sometimes-acceptable but often sub-standard "cheat" for doing it is to import the graphic and apply the autotrace feature (called LiveTrace in Illustrator). It's use is explained in the online help.
    Autotracing--the "conversoin" that such questions are almost always talking about--is not a lossless translation, like converting quarts to gallons or binary to hexidecimal. Entropy always rules. Anytime something is automatically "reprocessed" something is lost, not gained. You see that in everything from repainting a room over and over without removing the old paint, to taking photographs of photographs of photographs. Degradation occurs. You swap one kind of ugliness for another. That's autotracing when used inappropriately.
    The drawing tools exist for a reason. If you really need vector paths, you should probably draw them.
    JET

Maybe you are looking for