version 1.20, 2004/06/01 18:58:08
|
version 1.23, 2004/06/21 11:31:35
|
Line 189 public class DBBean
|
Line 189 public class DBBean
|
{ |
{ |
// setup the properties |
// setup the properties |
java.util.Properties prop = new java.util.Properties(); |
java.util.Properties prop = new java.util.Properties(); |
prop.put("charSet", "Cp1256"); |
// prop.put("charSet", "MacCentralEurope"); |
prop.put("user", user); |
prop.put("user", user); |
prop.put("password", passwd); |
prop.put("password", passwd); |
System.out.println("url "+url); |
System.out.println("url "+url); |
if(url.indexOf("odbc")>=0) |
if(url.indexOf("fmpro")>=0) |
{ |
{ |
// Connect to the database |
// Connect to the database |
connection = DriverManager.getConnection(url, prop); |
connection = DriverManager.getConnection(url, prop); |
Line 1379 public class DBBean
|
Line 1379 public class DBBean
|
byte[] b = null; |
byte[] b = null; |
if (metaData instanceof ResultSetMetaDataExt) |
if (metaData instanceof ResultSetMetaDataExt) |
b = resultSet.getBytes(i); |
b = resultSet.getBytes(i); |
|
/* if (b != null) |
|
{ |
|
java.io.ByteArrayInputStream stream = (java.io.ByteArrayInputStream) resultSet.getBinaryStream(i); |
|
// System.out.println(" stream "+resultSet.getBinaryStream(i)); |
|
byte[] c = new byte[stream.available()]; |
|
int length = stream.read(c, 0, c.length); |
|
int count = 0; |
|
b = new byte[c.length]; |
|
for (int n = 0; n < length; ++n) |
|
{ |
|
|
|
if (c[n] != 0) |
|
{ |
|
// System.out.println(c[n]+" "+(int)'?'+" "+(char)c[n]+" "+count+" "+b.length); |
|
b[count++] = c[n]; |
|
} |
|
} |
|
byte[] bCopy = new byte[count]; |
|
System.arraycopy(b, 0, bCopy, 0, count); |
|
b = bCopy; |
|
}*/ |
String utf8 = null; |
String utf8 = null; |
utf8 = (b == null) ? null : new String(b); |
utf8 = (b == null) ? null : new String(b,"MacRoman"); |
if (metaData instanceof ResultSetMetaDataExt) |
if (metaData instanceof ResultSetMetaDataExt) |
tableRow.addElement((b != null) ? new String(utf8.getBytes()) : null); |
tableRow.addElement((b != null) ? Convert.normanToUnicode(resultSet.getString(i)) : null); |
else |
else |
{ |
{ |
if(url.toLowerCase().indexOf("odbc")>=0) |
if(url.toLowerCase().indexOf("odbc")>=0) |
Line 1486 public class DBBean
|
Line 1507 public class DBBean
|
metaData = (this.result==null) ?null:this.result.getMetaData(); |
metaData = (this.result==null) ?null:this.result.getMetaData(); |
return t; |
return t; |
} |
} |
|
|
} |
} |
|
|