Solved

name equals object

Posted on 2007-11-19
6
211 Views
Last Modified: 2010-03-30
i have a image path name like
C:\Documents and Settings\User\My Documents\My Pictures\IIA\Metadata\TestingData\0060.jpg

and i store it in db (using hsqldb) during execution

but when i read the value back .. it returns it like this, with double backslash -

C:\\Documents and Settings\\User\\My Documents\\My Pictures\\IIA\\Metadata\\TestingData\\0060.jpg

is it right? or how can i access it so that it returns me path like i stored it .. and not with double backslash .. ??
0
Comment
Question by:max_dub
  • 4
  • 2
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 20312898
>>is it right? or how can i access it so that it returns me path like i stored it .. and not with double backslash .. ??

It probably needs to escape it to store it. Do a replaceAll on it

path = path.replaceAll("\\\\\\\\", "\\\\");
0
 

Author Comment

by:max_dub
ID: 20313028
i did as shown below.. but replaceAll.. doesn't seem to work..

>>It probably needs to escape it to store it
is it for storing in DB u mean?
String regex = "\\";

String replacement = "\'";

		

String temp = imageIDdata.instance(0).toString();

temp = temp.replaceAll(regex, replacement);

log.info(temp);

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20313069
I gave you the code above ;-)

>>is it for storing in DB u mean?

Yes
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:max_dub
ID: 20313134
thanks :)

do u think, if the path is smaller or longer, the replaceAll expression will still work without any changes .. i cudn't decode how it is replacing \\ with \ - replaceAll("\\\\\\\\", "\\\\")
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20313228
>>do u think, if the path is smaller or longer, ...

Yes it will work irrespective of length
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20313566
:-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now