source: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLSelect.java@ 5800

Last change on this file since 5800 was 5798, checked in by cs025, 21 years ago

Adding gs3build code

  • Property svn:keywords set to Author Date Id Revision
File size: 769 bytes
Line 
1package org.greenstone.gsdl3.gs3build.database;
2
3public class GS3SQLSelect extends GS3SQLAction
4{ GS3SQLWhere where;
5
6 public GS3SQLSelect(String table)
7 { super(table);
8 this.where = null;
9 }
10
11 public void setWhere(GS3SQLWhere where)
12 { this.where = where;
13 }
14
15 public String toString()
16 { StringBuffer reply = new StringBuffer();
17
18 reply.append("SELECT ");
19
20 for (int i = 0; i < this.values.size(); i ++)
21 { GS3SQLValue value = (GS3SQLValue) this.values.get(i);
22 if (i > 0)
23 reply.append(", ");
24 reply.append(value.field);
25 }
26
27 reply.append(" FROM ");
28 reply.append(this.table);
29
30 if (this.where != null)
31 { reply.append(" WHERE ");
32 reply.append(where.toString());
33 }
34 return reply.toString();
35 }
36}
37
38
Note: See TracBrowser for help on using the repository browser.