Board index » jbuilder » Variant - where is the jbuilder description of their variant of variant?

Variant - where is the jbuilder description of their variant of variant?


2004-02-16 12:56:01 PM
jbuilder9
On 1999/11/02 Tim Romano ( XXXX@XXXXX.COM )
suggested this useage:
v = new Variant();
queryDataSet1.getVariant(int rc, int cc,v);
String bean = (String)variant;
Sadly this does NOT compile...
the idea of "Variant" is now trendy, doubtless the subject of
many computer science lectures.
As an old-time programmer, who has no use for computerScience
All I want to do is get some data from a database and put it into
a file (comma seperated strings, since jdbc doesnt talk to Excel)
Assuming I have caught my "variant" how do I
cast it into a String?
I dont care if Computer Science graduates multiply entities
such that William of Occam is spinning in his grave,
as long as they describe the behaviour of their pet entities.
cheers
kelvin
 
 

Re:Variant - where is the jbuilder description of their variant of variant?

and the answer is: Nothing!
just use the + operator as overridden in String
mystring += Mystring + myvariant;
everything is done for youo, behind the scenes..
brilliant, and scary...
This procedure writes a comma seperated file, name is in "fotr"
void comot (String fot) {
FileWriter fw;
DataModule1 dma;
QueryDataSet persons;
dma = t21.DataModule1.getDataModule(); // t21 is my program|project
persons = dma.getPersons(); // persons is my table
String[] cname;
Column col;
int cty,j;
int cc = persons.getColumnCount();
String s;
Variant va = new Variant();
int ro;
cname = persons.getColumnNames(cc);
s = "";
for (j = 0; j < cc; j++)
{
col = persons.getColumn(j);
s += cname[j] + ",";
}
try
{
File file = new File (fot);
fw = new FileWriter(file);
}
catch (IOException ioe) {
Utils.shoer(this,"error 303 writing " + "..." + fot + "..." + ioe);
return;
}
try { fw.write(s); fw.write(0x0D); fw.write(0x0A); }
// there must be a better way of newline...
catch (IOException ioe) {
Utils.shoer(this,"error 304 writing " + "..." + fot + "..." + ioe);
}
s = "";
persons.first();
while (persons.inBounds())
{
s = "";
for (j = 0; j < cc; j++)
{
persons.getVariant(j,va);
s += va; // simplicity itself...
s += ",";
}
try { fw.write(s); fw.write(0x0D); fw.write(0x0A); }
catch (IOException ioe) {
Utils.shoer(this,"error 305 writing" + "..." + fot + "..." + ioe);
}
persons.next();
} // while inbounds
persons.first();
try { fw.close(); }
catch (IOException ioe) {
Utils.shoer(this,"error 303 writing" + "..." + fot + "..." + ioe);
}
} // comot____________________________________________________________________
 

Re:Variant - where is the jbuilder description of their variant of variant?

XXXX@XXXXX.COM (kelvinq) wrote in message news:< XXXX@XXXXX.COM >...
Quote
On 1999/11/02 Tim Romano ( XXXX@XXXXX.COM )
suggested this useage:
v = new Variant();
queryDataSet1.getVariant(int rc, int cc,v);
String bean = (String)variant;

Sadly this does NOT compile...

the idea of "Variant" is now trendy, doubtless the subject of
many computer science lectures.
As an old-time programmer, who has no use for computerScience
All I want to do is get some data from a database and put it into
a file (comma seperated strings, since jdbc doesnt talk to Excel)

Assuming I have caught my "variant" how do I
cast it into a String?

I dont care if Computer Science graduates multiply entities
such that William of Occam is spinning in his grave,
as long as they describe the behaviour of their pet entities.

cheers
kelvin
All you have to do is use the following example as a guide. I think it should help.
//for example
Variant v = new Variant();
//Put 5 into to our variant
v.setInt(5);
//Then just get it's value as a string
String str = v.getString();
It's not a direct cast but it should get "5" into the string representation.
Reagrds,
Ignacio Murillo
 

{smallsort}