Gale Greaser

+ Follow
since Aug 05, 2002
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gale Greaser

Thank you for your help!
I think I will just get x number or rows at a time.
I appriciate your responce!
Thanks for your reply!
All the data needs to be in one Excel spreadsheet.
Is there any other way of doing this without beans? Would it be better to put the ResultSet into the request and access the records in the ResultSet directly in the JSP?
Hi -
I'm wondering if it's wise to dump thousands of database records into a session bean to be displayed in a JSP who's MIME is that for an excel document. (An excel spreadsheet will be displayed in the browser window displaying all records in the database.
Please advise -
Hi -
I have a very strange error.
I am calling this code within a JSP.
for(int i=index; i<(index + increment); i++)
RecordBean record = recordListBean.get(i);


All I would like to do is get the record at index 'i'in the function " RecordBean record = recordListBean.get(i); "
I get an error page if I do this (don't know the exact error message), however - if I create an " int j=4; ", for example and use RecordBean record = recordListBean.get(j);
- this works just fine.
I tried to "trick" the code and assigned "int j = i; " within the loop. It recognized this and errored on me again.
Why can this function take in one int variable and not another?
I'm very confused.
Please help.
Thanks in advance.
19 years ago
I'm new to Weblogic7.0 and am using the Admin Console GUI to deploy my web applications.
I have deployed a very simple test app containing a JSP and a Servlet. The JSP works, the Servlet gives me a 500 - Internal Server Error in the browser and a ClassNotFoundException: moreservlets.HelloServlet2 error in the weblogic console. (along with some internal.ServletStubImpl.prepareServlet( stuff)
I deployed my app in an exploded file format:
-- test.jsp (works fine)
-- web.xml
-- moreservlets
-- HelloServlet2.class
My web.xml looks like:
I am using the URL: host ort/TestApp/TestApp

I'm wondering if there's any other set-up steps I need to do in the admin console to get my servlet to work (The only success I've found was deploying the folder - thats it).
I've deployed this servlet on Tomcat with no errors.

If anyone can help me out I will be extremely greatful!!
Thanks in advance -
19 years ago
Yep - my suspicions were correct.
I downloaded a new Oracle 9i driver from:
- And what d'ya know, it worked!
Must have had the wrong driver version.
Thanks for you help though!
Thanks for the suggestion, but I received the same error when I tried it.
Could it be something with the Oracle Driver JAR file I'm using?
- Gale
Hi -
I'm having trouble connecting to an Oracle database.
This is the code I try to connect with:
System.out.println("got driver.");

(dies here) --> conn = DriverManager.getConnection("url", "user", "pass");
System.out.println("got Connection");
This is the error message I get:
java.sql.SQLException: No more data to read from socket
void oracle.jdbc.dbaccess.DBError.check_error(short)
short oracle.jdbc.ttc7.TTCInBuffer.getByte()
byte oracle.jdbc.ttc7.TTIMsg.unmarshalSB1()
void oracle.jdbc.ttc7.O3log.receive2nd()
oracle.jdbc.dbaccess.DBConversion oracle.jdbc.ttc7.TTC7Protocol.logon(java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
oracle.jdbc.driver.OracleConnection(oracle.jdbc.dbaccess.DBAccess, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
java.sql.Connection oracle.jdbc.driver.OracleDriver.connect(java.lang.String, java.util.Properties)
java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties, java.lang.ClassLoader)
java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, java.lang.String)

Any suggestions?
Thanks in Advance!
Ahh ha!
I actually did what you had suggested and used a "Statement" instead of a "PreparedStatement".
Thanks so much for your reply - much appriciated!
Hello -
I am having problems setting values for my prepared statement (below).

psViewLogIncrement = conn.prepareStatement(
SELECT TOP ? * FROM Log WHERE (record_id >=(SELECT MAX(record_id)FROM (SELECT TOP ? * FROM Log ORDER BY record_id) nextRecords)) ORDER BY record_id
psViewLogIncrement.setInt(1, 2);
psViewLogIncrement.setInt(2, 2);

The values I would like to set are not data field values, but the number of values I would like the Select to return. The error I'm getting is:
"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s)."

Can anybody help?
Thanks in advance!
Here is the Prepared Statement I am trying to execute:
ps.modifyRecord = "UPDATE Log SET date_recv = ?, patient_name = ?, is_new_patient = ?, med_rec_nbr = ?, person_recv_intake = ?, uwhc_uwmf = ?, responsible_party = ?, address = ?, zipcode = ?, birthdate = ?, referred_by = ?, prev_med_care = ?, prim_care_physician = ?, reason_left_prev_provider = ?, reason_for_visit = ?, statement_sent_recv = ?, appropriate_facility = ?, comments = ?, needs_fin_screening = ?, decision = ?, updated_by = ?, date_updated=default WHERE record_id = ?
* When I replace the question marks with real data, wrap it in a Java Statement, it works just fine.
* However, when I execute it as a prepared statement:
// Set SQL Insert Information
psInsert.setString( 1, "2/2/2000");
psInsert.setString( 2, "sd" );
psInsert.setString( 3, "sd" );
psInsert.setString( 4, "12" );
psInsert.setString( 5, "sd" );
psInsert.setString( 6, "sd");
psInsert.setString( 7, "sd");
psInsert.setString( 8, "sd" );
psInsert.setString( 9, "12" );
psInsert.setString( 10, "1/3/2000" );
psInsert.setString( 11, "sd" );
psInsert.setString( 12, "sd");
psInsert.setString( 13, "sd" );
psInsert.setString( 14, "sd" );
psInsert.setString( 15, "123" );
psInsert.setString( 16, "123" );
psInsert.setString( 17, "123" );
psInsert.setString( 18, "123" );
psInsert.setString( 19, "123" );
psInsert.setString( 20, "123");
psInsert.setString( 21, "user" );
psInsert.setString(22, "1");

// Execute

... I get this error:
Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The identifier that starts with 'UPDATE Log SET date_recv = @P1, patient_name = @P2, is_new_patient = @P3, med_rec_nbr = @P4, person_recv_intake = @P5, uwhc_uwmf' is too long. Maximum length is 128.
* I'm terribly confused - can Prepared Statements only be of a finite size?
* Please help - Thanks in Advance!

Say "obj" is an Object that can be represented as a String.
Then you could use either of these:
String objectString1 = "" + obj;
String objectString2 = String.valueOf(obj);
Good luck!
19 years ago
I'm writing an application that needs to know if a given IP address is being used. Therefore I'm looking to find a the best and fastest way to [perhaps] ping an IP address.
I'm looking for something that works like this:
PingManager ping = new PingManager()
boolean pinged = ping("");
Right now I'm using HttpURLConnection.connect() to "ping". I'm not getting a warm-fuzzy with this method seeing as it takes a long time to return 'false' if the given IP is not being used.
I would like to know the best way to find if an IP is being used.
I was debating whether or not C++ would be a better candidate for this portion of the code.
Any ideas would be much appriciated.
Thanks in advance!
19 years ago
I had to restore my own version of the server.xml file on my server this morning. It appeared to have the original one back. Just trying to figure out what happened. I don't have a clue where it would have even got it the old one from.
There was a thunderstorm last night and the powerer did go out. Could this have any part in what happened?
Any ideas greatly appriciated!

19 years ago
Hello -
I am attempting to deploy my very first servlet on Tomcat following the directions in "More Servlets and Java Server Pages" by Marty Hall.
This is my Error:
4.0.4 -- "The requested resource(/webapp1/servlet/testservlet.HelloWebApp) is not available."

This is my directory structure:
---webapp1 - HelloWebApp.jsp
------WEB-INF - web.xml
------------testservlet - HelloWebApp.class
I am using the URL:
And I edited the server.xml in the conf directory to include:
- <!-- Tomcat Root Context -->
<Context path="/webapp1" docBase="webapp1" debug="0" />
The HelloWebApp.jsp works just fine - no problems.
Its just the servlet that I'm having difficulties with. I have checked everything I know to check many times... Is there something I am missing?
Perhaps something in the server.xml file?
Much thanks!
19 years ago