This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
    Bookmark Topic Watch Topic
  • New Topic

open document using if statement

 
orelia hans
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Report post to moderator
I tried to attach files to my database for me to be able to retrieve those documents on the web using an id number. I used binary objects but it didn't work.
Now I am using a method to read the id from the web then open the document. I think it can work but I don't know how.
On the jsp page I have :
out.write(""+publicationNum+"</td>");
Then on the other hand :
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc dbc:AcessCore");
publicationNumber = request.getParameter("id");
out.println(publicationNumber);

if(publicationNumber=="NNR1")
{
??? how do I open a specfic document when you click on the link?
}

else if(publicationNumber=="NRR1")
{
href="C://hello.doc"; doesn't work
}
rs.close();
s.close();
con.close();
}
catch (
ClassNotFoundException e1) { }
catch (SQLException e2) { }
I have like 100 publications and I have to do this one by one. Can someone tell me how to do that? opening the document as a new window.
Any help will be so much appreciated.
Thanks
[ February 16, 2004: Message edited by: Paul Wheaton ]
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Intersting. This post has nothing to do with Linux. I mean, you aren't even on a Linux machine. I know this because of the line
href="C://hello.doc"; doesn't work

Oh well, moving to JSP.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64607
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Actually, since this is a dupe of a question already asked in this forum, I'm closing this topic.
orelia, please do not cross-post the same question in multiple fourms.
 
    Bookmark Topic Watch Topic
  • New Topic