Java to create hyperlinks from database-specified paths
Hi, I�m using Tomcat 5.5/Java 5.0. and Windows 2000 and Internet Explorer 6
I have a network path specified in a MySQL database table (e.g. one path might be: \\Rpfs01\Department\Finance\Public\Requisitions 4000+\req 4005 Sigma.xls)
I�d like to query this database table and display the results in an HTML table with the above path to be used as a hyperlink (i.e. the user clicks on the hyperlink and up pops a 2nd page containing the xls file specified by the path).
the problem is that web-page is viewing the path as containing escape characters. (i.e. if I click on the link as specified above, I get a file not found error. But if I add extra backslashes directly to the html code, the link works fine [e.g. \\\\Rpfs01\\Department\\Finance\\Public\\Requisitions 4000+\\req 4005 Sigma.xls]).
Is there a way to have java automatically add the required back-slashes to make this work? I tried replaceAll (i.e. myPathString.replaceAll(�\\�, �\\\\�) ) but this is giving me a PatternSyntaxException.
Any suggestions on how to fix?
Thanks!
Have you tried the URLEncoder class? Something like:
String urlPath = java.net.URLEncoder.encode(networkPath, "UTF-8");
Similar Messages
-
Create application from database issues
Just trying out the 'Create application from database'
feature and found the following.
Running:
Vista
Flex Builder 3 Public Beta 2
Visual Studio 2008
- The wizard cant find the development web server so IIS is
the only choice. I assume VS2005 & 2008 are different.
- When validating the IIS option it would always fail until I
enabled directory browsing (IIS 7).
- When creating a SQL connection the wizard will not connect
to a SQL 2005 named instance. Tried 'localhost\instance' and
'hostname\instance' and get the following error.
java.sql.SQLException: Unknown server host name
'DMC\DEV2005'.
at
net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:364)
at
net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
DaveHi Dave,
Would you please file a bug with all the necessary details
regarding this issue? The bug base is found at:
http://bugs.adobe.com/jira.
We’ll look into this. Thank you for letting us know!
Lacra -
Create app from database doesn't work
hi all, i am new to developing in flex, and just set up a
test-database (php, mysql) - i created a php project, and when i
choose data->create application from database nothing happens
... just nothing ... any help would be very much appreciated, i am
sure it's a no-brainer, but i just can't figure it out at this
stage ... i run a full version of flex 3 proDid you check the online documentation ? [http://help.sap.com/abapdocu_70/en/ABAPIMPORT_MEDIUM.htm#&ABAP_ALTERNATIVE_4@4@]
I see your code has differences from the example provided in the standard documentation. -
"Create Application from Database" and BLOB type
Hi all,
I see many threads about BLOB type but my question is related to the Flex Builder built-in feature "Create Application from Database".
Is there a way or a sw version to automatically use MySQL BLOB types when creating a PHP/database application?
Thank you!Hi Dave,
Would you please file a bug with all the necessary details
regarding this issue? The bug base is found at:
http://bugs.adobe.com/jira.
We’ll look into this. Thank you for letting us know!
Lacra -
Create Application from Database and Air
I have tried several time to use the create application from
database for an air app build in flex. I do the same steps and the
only difference is that I click the create button as air not web.
It does not seem to work. Does the create application from database
command (referencing php mysql) work with Air???
ThanksHi Dave,
Would you please file a bug with all the necessary details
regarding this issue? The bug base is found at:
http://bugs.adobe.com/jira.
We’ll look into this. Thank you for letting us know!
Lacra -
Flex / Data / Create Application from Database
Hi, I had a question,
When I create an application from a Database (Flex / Data /
Create Application from Database).
Can I modify the coded to convert it into a module?
I have a main application that I would like to load the
Database as a module. I tried replacing the <mx:Application>
Tags to Module but didn't work...
Thanks.Hi,
no. no answer as yet. Seems to be a connection issue with the
Windows 2003 Server, although all the seetings are correct.
I installed WAMP Server 2.0 locally to see if I can get the
project running locally, and it works fine. I can connect no
problem to the MySQL Database on my local PC. I might just have to
migrate everything over manually once the project is
complete. -
After "create application from database"
hi all,
i succeeded to build server and client side code using "create application from database"
now my question is: how to use these files to build my application?
for example, i need an OlapDataGrid that works on joined tables, not on a single table...
thank you all!Hi Dave,
Would you please file a bug with all the necessary details
regarding this issue? The bug base is found at:
http://bugs.adobe.com/jira.
We’ll look into this. Thank you for letting us know!
Lacra -
Parsing hyperlink from Database in PHP
Hi,
I need to populate the hyperlink from database. The rule is
if the hyperlink equal to "-", then it returns "-". Otherwise, it
will returns the hyperlink from database. Attached herewith is the
code.
However, whenever I click on the hyperlink, the link will
becomes
http://www.domain.com/www.LinkFromDatabase.com.
Why it always append the web site's address?? Do I miss
something?edwin@aw wrote:
> However, whenever I click on the hyperlink, the link
will becomes
>
http://www.domain.com/www.LinkFromDatabase.com.
Why it always append the web
> site's address?? Do I miss something?
This is happening because your link doesn't begin with
http://.
> echo "<a href='$link' target='_blank'> $link
</a>";
This should be echo "<a href='
http://$link' target='_blank'> $link
</a>";
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Hi,
I have a table in database that has files uploaded from front-end like XLS, DOC, PDF,TXt etc.
I need to create a report that shows the filename as hyperlink and when user clicks the link, it should open the attachment in Excel if .XLS, Adobe if .PDF ..
Ex: Filename
Test.xls
plan.Pdf
roadmap.doc
Where all entries under "Filename" column is hyperlink and when user clicks hyperlink, it opens the appropriate document
Can we get this done in BI Publisher out of the box or do we need any custom code?
Advance thanks to everyone for their valuable feedback.
Edited by: S00000 on Sep 14, 2012 12:15 PMok
>
I have a table in database that has files uploaded from front-end like XLS, DOC, PDF,TXt etc.
>
in my humble opinion it's not good solution
why in table? why not use bfile?
if you want select blob from your table you must always download it to some directory on server in sql/plsql way
or if you use, as example, c#client then you can download it as byte stream to client side
if you use bfile then your file stored on some server directory and you can work with by ftp, http as for ebs sample
so in this case you can't have problem with attachment, you can use url+filename in your report
--add
>
Iam looking for a solution where I can show attachments in BIP report from Database directly.
>
i not sure as it looks like
one big report with embedded many other files?
or how?
Edited by: AlexAnd on Sep 19, 2012 11:21 PM -
Cannot create File at the specified path
I've been trying to create a file but I don't know why Java do not create it.
I don't get any exceptions so I really don't know where the problem is.
Here is my code where I triy to create the file:
System.out.println(MainMailer.class.getResource("").getPath().substring(1)+"Data/account.data");
File file = new File(""+MainMailer.class.getResource("").getPath().substring(1)+"Data/account.data");Thnaks in advance,
Juan>>
System.out.println(MainMailer.class.getResource("")
I don't know what you're expecting that to return.
I'd expect that it might return the URL to the FIRST
path in your classpath, which I wouldn't rely on to
be where your MainMailer class lives. You should not
be coding like this. Let there be a system property
or configuration file (which you read from the
classpath) which tells you where to store the files.
Don't try to magically determine the path of where
your MainMailer class lives. For another reason,
MainMailer may live in a JAR/WAR/EAR file, so there
is no "file path" to it. Bad design.I use this line like some sort of flag so I can see the path that I'm using. In fact, that path is the correct one, is where I want to create my file. -
Hi ALL,
Can any one help us regarding How to fecth the Date column(or month column) from the file name specified in the path in a generalized way .
For example :
file name is :subscribers (Cost) Sep13.csv is specified in the below path
E:\Accounting\documents\subscribers (Cost) Sep13.csv
here I need to fetch the "Sep13" as a Date column in the ODI 11g in the generalized way.
Can any one help us in this case as early as possible.I would suggest using a piece of Jython code for this. Something like this...
import os
import os.path
filelist = os.listdir(E:\Accounting\documents\)
for file in filelist:
datestr = file[19:-4]
You'd need to work out what to do with datestr next... perhaps write it to a table or update an ODI variable with it.
Hope this is of some help. -
Firefox no longer creates hyperlinks from email addresses in my emails
It used to be that when I created an email that contained an email address, the address would be displayed as a hyperlink. NOW the email address seems to be just text.
I checked the same thing in IE and it still displays the email address as a hyperlink, so I assume the issue is with Firefox.Well I would assume the email you received from Apple explains why you can't.
-
Create View from Database Links - Question
Question
I'm missing something simple.
I'm trying to create a view, from a Database Link.
CREATE VIEW view_name
AS SELECT a.*
FROM schema.tablename@dblink a;
When I run this in the SQL Commands window.
I get this error message.
ORA-00933: SQL command not properly ended
What am I missing? Any help is appreciated...<i>CREATE VIEW vw_name
AS SELECT a.*
FROM [email protected] a;
</i>
<br>
1) User (schema) which is creating view must have proper db_link to source database. For that try this for testing purpose:
select 1 from [email protected]<br>
If this fail then db_link is not ok! This step is absolute must to go any further step to!!!
<br>
2) when db_link is set, then your view should be named as:
CREATE VIEW vw_name
AS SELECT *
FROM <b>schema_name</b>.[email protected];<br>
please pay attention to "schema_name", because from remote side every table is in some schema so it really need declaration of owner schema.
<br>
Hope this helps... -
Dynamic hyperlink from database table
hi,
I have requirement to create left hand menu on a page. Menu label and hyperlink is stored in database. What is the best way to achieve this. Basically when user logs based on his user name query will fetch the labels and hyperlink source. How to achieve this in ADF? I could not find anything out of the box. I have view object which stores that information but i dont know how to convert that information into hyperlinks.Assuming the UrlInfo is the name of the View Object that has the attributes label & link, you can use the af:iterator to show the labels & links as follows:
1) Drag & Drop the UrlInfo into the page as a table. Delete the table in the .JSPX page and keeping the pageDef as it is.
2) Instead of the af:table, use af:iterator to show the same.
.JSPX page sample:
<af:iterator value="#{bindings.UrlInfo.collectionModel}" var="row"
rows="#{bindings.UrlInfo.rangeSize}" id="t1">
<af:goLink id="g1" text="#{row.label}"
destination="#{row.link}"/>
<af:spacer height="1px" id="sp1"/>
</af:iterator>
PageDef sample:
<executables>
<variableIterator id="variables"/>
<iterator Binds="Employees" RangeSize="25"
DataControl="AppModuleDataControl" id="UrlInfoIterator"/>
</executables>
<bindings>
<tree IterBinding="UrlInfoIterator" id="UrlInfo">
<nodeDefinition DefName="model.UrlInfoVO">
<AttrNames>
<Item Value="label"/>
<Item Value="link"/>
</AttrNames>
</nodeDefinition>
</tree>
</bindings>
Thanks,
Navaneeth -
How to read jpg image from a specified path
Hi
I am having an image in jpg ext, so i am using File nf = new File(path);to read the image, now i have to place that jpg image in an byte/String array so from that i will save that in to the Oracle DB with BLOB data type, plz answer to this asap with code......
the following code is not useful i think so...
String st = "C:\Documents and Settings\Sasi\Desktop\sasi.jpg"
File infile = new File(st);
BufferedImage im = ImageIO.read(infile);
String[] reader_names = ImageIO.getReaderFormatNames();plz reply to this asap,
regards
sasiSasi9 wrote:
String st = "C:\Documents and Settings\Sasi\Desktop\sasi.jpg"
File infile = new File(st);
//BufferedImage im = ImageIO.read(infile);
//String[] reader_names = ImageIO.getReaderFormatNames();
byte[] buffer = new byte[infile.length()];Now use a RandomAccessFile to read the file into your byte array. [readFully(buffer);|http://java.sun.com/j2se/1.4.2/docs/api/java/io/RandomAccessFile.html]
Maybe you are looking for
-
XML File - Problem.with naming tags with XI standard functions
Hello, simple (?) problem: Receiver expects an XML file via file adapter. (The source data comes from an RFC connect to XI.) In the XML tags like these are expected (following W3C definitions): A) </gdt:ValueGroup> How to define a data type with a
-
How to use iMovie HD in Yosemite!
Thanks to Ziatron for discovering this. One goes to the crossed out iMovie HD application, right click on it, open package contents, then macos, then right click on iMovie HD which opens in terminal. No worries, just leave the terminal window open, a
-
Help! I have a 3G iPhone. I have some music on it, but I can't add any more. I have it set up to manually manage music and ring tones. Any suggestions? I'm using a MacBook Pro and have the latest software on all devices.
-
IPhone, Excel Spreadsheet Cell Formatting Incorrectly
I am opening a "Mortgage Rates" spreadsheet on my iPhone. The rates are showing up as numbers, instead of percentages. For example: a rate on the spreadsheet will be 4.00%. It translates that on the spreadsheet on my iPhone as 0.040%. I did figure th
-
I'm trying to order an album and I'm getting this message: Your book seems to have frames on one or more pages that do not contain photos. You must either change the layout of those pages or place photos in those frames before you can proceed with th