Alan Watts

Greenhorn
+ Follow
since May 14, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alan Watts


Rohit,
You can do this with javascript I suppose, but have you considered doing it a slightly differently? Using a TextField in the applet you can read the value entered into the TextField as a String and then parse it if neccessary:
TextField Textfield;
String line = Textfield.getText();

Cheers
Alan
18 years ago
Madhav,
Many people drive Ladas as well. The following discussions shed a little more light on the subject:
http://w6.metronet.com/~wjm/tomcat/2000/Feb/msg00307.html
http://www.javaranch.com/ubb/Forum7/HTML/000303.html
Cheers
Alan
18 years ago

Jason,
I would tend to agree with that point on Swing, but I suppose the difference between the Flash plug-in and the Java RE plug-in is that with Flash you don't have all these millions of incompatible installations out there in the market.
I suppose as a rule if you were building Swing applets, then you would ensure that it prompted for a plug-in in cases where an old JRE was detected.
Cheers
Alan
18 years ago
Hi there,
Here are some excerpts on the subject that I produced for our company on the subject. They include some randomn quotes from newsgroups. The only thing I would add to it is, that as I understand it, the deficiency is with Windows XP (not the browsers) ie. the java runtime environment normally came bundled with the Win98 system and such like, rather than the browser per see. Also, it seems that Sun is just as guilty as Microsoft on this one.
Cheers
Alan

Windows XP is now for sale, and IE6, which will come bundled with this, is now available for beta testing):

"..the terms of settlement between Microsoft and Sun
do not allow MS to include a JRE with future versions of Internet
Explorer(i.e., MSN Explorer and Internet Explorer 6). As far as I can tell
by next year the only browser with built-in Java support will be Netscape
(Mozilla, Opera and the text-based browsers don't appear to support Java...
....As you can probably guess, this means the usefulness of a Java based
client is probably going to be limited in the future...."

Or see the following:
http://www.zdnet.com/zdnn/stories/news/0,4586,2678702,00.html

The only resolution to this kind of problem is for the enduser to download a plug-in Java Runtime Environment (jre) which would allow the applet to run properly. Actually, there is a suggestion that IE6 will auto-prompt to download an entire jre when encountering java sites. Given the popularity of Flash maybe this isn't a big deal.
If we go ahead and build applets into the various websites, then in the near future (as Windows XP (with IE6) starts leasing) we will be faced with the prospect that some users may not be able to properly interact with our websites, and for some of them, a plug-in will be an unnacceptable download on dial-up connections.
18 years ago
Hi there,
I've heard it loosely mentioned that Tomcat can't really be used for commercial applications. Is this really true? What are its limitations with respect to other commercial servlet engines?
Cheers
Alan
18 years ago

On obfuscation now. Does anyone know of an index of java methods that are susceptible to being mucked up by the popular obfuscators? By mucked up I mean prevented from working as Sun intended during runtime.
Cheers
Alan
18 years ago
Meng,
Assuming that you have the bridge already referenced in the classpath (Perhaps due to it being in the same directory as the standard java classes), then perhaps the problem you have is related to your attempts to use the applet on a network? The Sun bridge is a fairly simple type I driver, and as I understand it cannot be used on a network?
Cheers
Alan Watts
18 years ago

OK guys,
NO need to reply to my above topic. There were several areas of naughtiness in those statements. Interested parties are free to email me in order to find out what not to do.
Cheers
Alan
18 years ago

Hi there,
This is probably more a question for the JDBC section, but there is a dearth of activity there at the moment. I was wondering if anyone had experience populating an array by iterations of a SQL query loop.
For example, I am performing SQL on a DB which returns values from 2 columns in the DB, and which are Selected via incrementing an index value:
----------------------------------
//I set up index conditions for the loop
for (int x = 1; x < 7; x++) {
//Meaningless SQL query done by PreparedStatement
PreparedStatement pstmtx = con1.prepareStatement("bla bla bla = ?;");
pstmtx.setInt(1, x);
ResultSet rx = pstmtx.executeQuery();
if (rx.next()) {
xpoint = rx.getInt("bla1");
}
PreparedStatement pstmty = con1.prepareStatement("more bla bla = ?;");
pstmty.setInt(1, x);
ResultSet ry = pstmty.executeQuery();
if (ry.next()) {
ypoint = ry.getInt("bla2");
}
//I declare a couple of arrays
int[] xpointE = new int[7];
int[] ypointE = new int[7];
//I then try and force the results of the querys to become
//elements of the first declared arrays.
xpointE[x] = xpoint;
ypointE[x] = ypoint;
//I declare another 2 arrays
newX = new int[7];
newY = new int[7];
//I try to conduct calculations on the elements of the
//previous arrays so as to populate the above 2 arrays
newX[x] = ((int)(100 + 300*(1800-xpointE[x])/1800));
newY[x] = ((int)(30 + 200*(variable-ypointE[x])/variable));
}//close iteration loop
----------------------------------
Does the above seem sensible? Most examples on the web deal with meaningless arrays generated by simple incrementing functions. But has anyone tried populating arrays by repeated SQL queries of a database?
Interestingly, the JDBC API 2.0 supports the getArray method, which would make life considerably easier, although with most commercial driver/database solutions out there, this method is not supported - so please don't explain how to use getArray, as I've been down that road.

Thankyou
Alan Watts

18 years ago
Nathan,
You are of course right, I am probably silly to try this. Thankyou anyway.
Alan
18 years ago
Hi there,
Does anyone know of a way to execute a paint statement (for example g.drawString(String s, int, int); ) within the run() method block in an applet? ie. I don't want to place the statement within the normal public void paint (Graphics g) {} method block.
Cheers
Alan
18 years ago
Jeff,
To add to what Daniel said, in Win98 setting up your DSN (which is like a pointer to a DB file on your system) is relatively straightforward - you need to go to the Control Panel and then open up the ODBC Data Sources icon, and then follow the instructions (fairly simple for Access - perhaps not so simple for say SQLServer). I don't imagine setting up a DSN in Windows 2000 is terribly different.
As Daniel said, using the Sun JDBC:ODBC bridge is a fairly temporary measure - it is a type I JDBC driver, and as I understand it will not work over the internet. So, if you are publishing your Access DB on the web, you will need a commercial driver. I have tried Type III drivers from the following sources (type III drivers are also like the Sun JDBC:ODBC bridge but more sophisticated):
http://www.easysoft.com/ http://www.j-netdirect.com
Both of these work nicely with MS Access in my hands, but you can also view a more complete selection of drivers from the Sun site.
Cheers
Alan Watts
Hi there,
Does anyone know off-hand if the latest ODBC driver for SQLServer will handle JDBC arrays (part of the JDBC 2.0 API)? If not, what common DB would you recommend that does handle JDBC arrays (with ODBC or not)?
Thankyou
Alan Watts

I gather this Extension of Statement is of relevance to sophisticated applications such as parametric SQL statements that have a a bit of overhead. So, the advantage would be pure efficiency.
Cheers
Alan
OK people,
No need for anyone to respond on this topic, as I have solved the problem. If you are interested, the problem occurred because my commercial JDBC driver does not support the JDBC 2.0 API (but rather is still at JDBC 1.2). In other words, it cannot support advanced data types such as Array objects.
Alan