George Larry

Ranch Hand
+ Follow
since Nov 07, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by George Larry

I'm developing an application that will be used on a semi-large intranet.
There are multiple servers and each of them share a similar cvs file that gives information relative to itself. Every file is located in the same location and has the same name.
I would like to make a page that lists all the servers on the network and allows you to select any of them and have that files text displayed.
Is this possible? I've done something similar in the past, but only with local files (to the client) and using ActiveX, or files located on the web server. I don't know how, or if it is possible to get network information (from either the client or the server- it doesn't matter which because it'll be the same either way)...
If anyone can help me out I would be most grateful.
Thank you.
21 years ago
JSP
Also... can I put an if inside an out.println()?
Like this:

It would be nice if something like that worked... If anyone has done anything like that- please let me know how to make it work.
Thanks,
-GL
22 years ago
JSP
I think I remember seeing someone write an if-then statement in one quick line... like:
if (blah == true) superBlah = y:n
Where... if the statement is true then superBlah ='s y... if not it's set to n.
Could someone please verify this and correct my syntax?
Thank you kindly,
-GL
22 years ago
JSP
What if I'm not sure on the length? It could be anywhere from 0 to 100...
I tried this:

I'm getting an error:
Variable listDept may not have been initialized (both when I'm trying to set it and when displaying it).
How do I initialize it... I thought I did. Also- Do I have to set the size when I initialize it? If I do that- and set it to 100, for example, and the query returns 4 names... will I get 96 ( null + "<br>" )'s?
Thanks,
-GL
22 years ago
JSP
Hi...
I have a query that returns 1 field from my db. Like last name...
query = "select distinct name from table";
rs = stmt.executeQuery( query );
Now... I want to create an array of all the names... How can I do that?
I thought I could do this...
String[] listNames = rs.getArray( "name" );
But that's not working...
Thank you for your help,
-GL
22 years ago
JSP
I have a page that works just fine... I make numerous calls to the db with no problems... until- I try to run this report.
It looks something like this:

So... I've been able to get this to work (though it's very slow) when I only run it for 1 dept (the first cs), but if I try to run it for everything... it takes 7 forevers, returns some data then dies giving me the following error:
java.sql.SQLException: No more data to read from socket
What does that mean... and/or how can I fix it? Is my code bad (is this bad practice?- I tried combining all the statements, but that required 5 joins- which took even longer)?
I'd appreciate any help.
Thanks,
-GL
I'm experiencing a small problem...
I created a page that takes text from a file on my machine to play with... This worked great while I was running tomcat on my machine, but I tried to move it to the server and now it can't locate the (local) file... I suspect that, even though I'm browsing on my machine to locate the file, once I give it the path... it (the server) is trying to find the file on itself (the server).
Is that what is happening?
If so... How do I work around that? Do I have to upload all the files to the server before I can access them or is there some way to retrieve files data from the users machines?
Any ideas on what to do and how to do it would be appreciated.
Thanks,
-GL
22 years ago
JSP
Right... I've got that part... Now- How do I read the file? How do I append to it (tag something on the end of the file (like the date that it was read)?
Thanks,
22 years ago
JSP
I need to be able to select a text file (I'm using <input type="file"> then read the file (not sure how this is done...) and finally add some text to the end of the file (again, not sure how this is done)...
Does anyone know of a tutorial- or is this done easily enough that you can explain it to me here?
The file will be local- so there's no uploading... I've read through some stuff on uploading, but they stopped as soon as the file was uploaded- so I never learned how to read/write to it.
Thank you,
-GL
22 years ago
JSP
Is there a way to make it print out in Landscape (as opposed to portrait)?
22 years ago
JSP
I'm trying to create a ResultSet that I can scroll through...
I know by default ResultSets are set up to be read Forward_Only (so I could only use rs.next()), but I'd like to be able to use rs.previous(), and rs.first().
I've tried setting up a Statement like this:

But I get some AbstractMethodError and a servlet exception: oracle.jdbc.driver.OracleConnection.createStatement...
... which is not very helpful. I don't understand what I'm doing wrong.
Has anybody out there ever successfully created a scrollable ResultSet? If so... could you help me out?
Thanks a bunch!
22 years ago
JSP
What is the standard authentication mechanism and where can I learn how to use it?
22 years ago
JSP
Hmm... I tried that, but I'm getting an IllegalStateException.
Here's what I've done (in my header.jsp file):

Any ideas?
22 years ago
JSP
Try this:

ITEM should be the name of the column in the db. (SELECT ITEM FROM TABLE), alternatively you can do this rs.getString( 1 ) which will return the 1st column your query returns.
22 years ago
JSP
I'd like to create a session for my web page that expires after 15-20 minutes- then, once expired, have the user forwarded to the login page.
I think I've got the timing thing down...
session.setMaxInactiveInterval( x );
The part I don't know how to do is check for the invalid session and do the forward. I haven't found any way to tell if the session.isInactive();
Here's what I'd like to do:

There is no isInactive() function... that I know of. How can this be done?
Thank you.
22 years ago
JSP