Andy Patoel

Greenhorn
+ Follow
since Jul 09, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Andy Patoel

I have a JSP file that creates a Java object, and that Java object attempts to open a file using FileReader to get some data out of it. However, when I input the filename( FileReader myFileReader = new FileReader( "myFile.txt" ); // not my usual naming conventions, just an example ), I'm getting a File Not Found error. Where should the file I want to read (myFile.txt, in this example) be placed on the server (which directory) so that my Java back-end can read it?

Thanks,

Andy
20 years ago
JSP
What I did with the String thing is I thought perhaps my String was getting copied by pointer location and then maybe it was disappearing - not the case. I didn't put the stack trace on because I'm compiling on another computer - but basically when it hits the line that says return, it spits out a error like:

java.sql.SQLException: No data found
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6238)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3292)
...


why can't I return the value to my JSP front-end?

Thanks,

Andy
Ok, so I'm writing a JSP front-end that opens up a Java class (well, multiple classes with inheritance), and gets a value from an Access database (just for test). anyway, I can print the value to the screen as many times as I want when copied to a variable, and I can pass it around inside the program, but the minute I attempt to return the String, it pukes out. Here's my code:

try
{
// Creates an entirely new object to avoid pointer errors
String result = new String( results.getString( "FIELD_NAME" ) );

// Works with just any number of sys-outs, just proving it's not
// an issue with accessing it multiple times
System.out.println( result );
System.out.println( result );

return result;
} // error catching stuff next...

So what's going on here, why am I getting this error? Thanks for your help!