Base64 Problem
encoding is working well and decoding without origional shape. please check my code and help me. thanks
Origional:
this is
the first
encode/decode
example
Encoded:
dGhpcyBpcyANCnRoZSBmaXJzdA0KZW5jb2RlL2RlY29kZQ0KZXhhbXBsZQ==
Decoded:
this is the first encode/decode example
<!--file1.java>
String desc2=req.getParameter(揹esc2?;
String encodedString = Base64.encode(desc2);
PreparedStatement ps = cnn.prepareStatement(搃nsert into aa(desc2) values (?)?;
ps.setString(1, encodedString);
ps.executeUpdate();
ps.close();
<!--file2.java>
desc2=rs.getString("desc2");
byte[] decodedBytes = Base64.decode(desc2);
String decodedString =new String(decodedBytes);
out.println(decodedString);
[921 byte] By [
Javahlpa] at [2007-11-26 21:26:24]

Edit: Nevermind. Missed the "getParameter" somehow.
> Edit: Nevermind. Missed the "getParameter" somehow.nopes, this is not the problem and I mentioned the req.getParameter in file1.java if you read the code pleasethanks for your reply
@op: when I use com.sun.org.apache.xml.internal.security.utils.Base64everything decodes as expected. I suspect it's a quirck in your Base64en/decoder (the encoding is correct).kind regards,Jos
The actual string you are encoding isString value = "this is \r\n"+
"the first\r\n"+
"encode/decode\r\n"+
"example";
which I get from decoding you encoded value using my own Base64 decoder and the sun.misc one. As Jos says but without the profanity, your decoder is f******.
> > Edit: Nevermind. Missed the "getParameter"
> somehow.
>
> nopes, this is not the problem and I mentioned the
> req.getParameter in file1.java if you read the code
> please
>
> thanks for your reply
Before you get snotty, you will notice that entire post is an edit, erasing the original post. The edit says to nevermind the original post because I overlooked the getParameter in your code somehow, not because you didn't use it.
> Before you get snotty, you will notice that entire
> post is an edit, erasing the original post. The edit
> says to nevermind the original post because I
> overlooked the getParameter in your code somehow, not
> because you didn't use it.
please don't get "Parameter" issue seriously and let me know the solution if you can
You were given the solution already. Use a different Base64 encoder/decoder.
> @op: when I use
> com.sun.org.apache.xml.internal.security.utils.Base64
> everything decodes as expected. I suspect it's a
> quirck in your Base64
> en/decoder (the encoding is correct).
Can you please get me the url to download with examples
thanks & regards
> Can you please get me the url to download with examples
>
> thanks & regards
You're welcome of course; that Base64 class was on my build path
by sheer serendipity; here's another [url=http://www.source-code.biz/snippets/java/2.htm]link[/url].
kind regards,
Jos
Thanks Jos I downloaded the the package that contains 4 java files and compiled. can you please change my first posted code according to these filesthanks
> Thanks Jos I downloaded the the package that contains> 4 java files and compiled. can you please change my> first posted code according to these files> > thanksWould you like some fries with that?
> Would you like some fries with that?Actually there is no example with this package and when am compiling the same code its giving errorsso please help me to solve this issuethanks & regards
> Thanks Jos I downloaded the the package that contains 4 java files > and compiled. can you please change my first posted code according > to these filesThere are proper API docs available from that link you know ...kind regards,Jos
> There are proper API docs available from that link> you know ...I am unable to find the api docs on the page
Sorry Jos I found the API's thanks & regards
See reply #7 in http://forum.java.sun.com/thread.jspa?threadID=5148690&tstart=0 .
> See reply #7 in> http://forum.java.sun.com/thread.jspa?threadID=5148690> &tstart=0 .Sabre150: Your are doing good work. Keep it on and see that for the last two weeks java professionals are not able to solve my problemkeep it up
> > See reply #7 in
> >
> http://forum.java.sun.com/thread.jspa?threadID=5148690
>
> > &tstart=0 .
>
> Sabre150: Your are doing good work. Keep it on and
> see that for the last two weeks java professionals
> are not able to solve my problem
That is not at all fair on the forum members. You presented the problem as a Base64 problem but it has nothing at all to do with Base64. It is an HTML problem.
> That is not at all fair on the forum members. You> presented the problem as a Base64 problem but it has> nothing at all to do with Base64. It is an HTML> problem.if this is HTML problem correct it. don't make answers in air
> > That is not at all fair on the forum members. You
> > presented the problem as a Base64 problem but it
> has
> > nothing at all to do with Base64. It is an HTML
> > problem.
>
> if this is HTML problem correct it. don't make
> answers in air
YOU have to learn HTML! I don't know how you want to present the text so I don't know what tags you need. This is a Java forum and not an HTML forum and even if it was an HTML forum you can't demand we do anything!
You need to fucking read some manuals!
> > That is not at all fair on the forum members. You presented the
> > problem as a Base64 problem but it has nothing at all to do with
> > Base64. It is an HTML problem.
>
> if this is HTML problem correct it. don't make answers in air
Didn't your mother ever teach you to say "please" when you're asking
someone to do you a favour?
kind regards,
Jos
JosAHa at 2007-7-21 18:17:25 >

> > > That is not at all fair on the forum members.
> You
> > > presented the problem as a Base64 problem but it
> > has
> > > nothing at all to do with Base64. It is an HTML
> > > problem.
> >
> > if this is HTML problem correct it. don't make
> > answers in air
>
> YOU have to learn HTML! I don't know how you
> want to present the text so I don't know what tags
> you need. This is a Java forum and not an HTML forum
> and even if it was an HTML forum you can't demand we
> do anything!
>
> You need to fucking read some manuals!
Actually you didn't get my problem exactly even you didn't read the postings that what I need but just to showing off by replying just for none
first read my first postings and then come to discuss
fucking read some manuals!
>
>
> Actually you didn't get my problem exactly even you
> didn't read the postings that what I need but just to
> showing off by replying just for none
>
> first read my first postings and then come to discuss
You are a piece of ungrateful sh1t! I had to guess what your real problem was because you seemed determined that it was a Base64 problem when it was nothing to do with Base64.
Go to hell!
> Sabre150: Your are doing good work. Keep it on and
> see that for the last two weeks java professionals
> are not able to solve my problem
Please do excuse me for assuming that someone who was writing Java code in a JSP, and trying to encode and decode Base64, would have the basic web knowledge that is required to know that a newline character in a web page would not automatically translate to a
tag, and cause a new line to appear in the web page. I mean, after all, that is HTML, and has absolutely nothing to do with Java web programming.
You, sir, are truly the lowest common denominator among the Java web people.
The fact that you have the audacity to berate me for trying to help you absolutely floors me. You'll go far in your career.
KevJava and Sabre150:
You have not read my first post and talking a lot just for none.
Please read my post that when am inserting data into oracle db it encodes well but when am decoding to display from my db it doesn't decode in origional shape from db.
this is my problem
> KevJava and Sabre150:
> You have not read my first post and talking a lot
> just for none.
>
> Please read my post that when am inserting data into
> oracle db it encodes well but when am decoding to
> display from my db it doesn't decode in origional
> shape from db.
>
> this is my problem
You problem seems to be that empty void between your two ears.
> KevJava and Sabre150:
> You have not read my first post and talking a lot
> just for none.
>
> Please read my post that when am inserting data into
> oracle db it encodes well but when am decoding to
> display from my db it doesn't decode in origional
> shape from db.
>
> this is my problem
You are an obstinate twit. That might be because the first post of your [url=http://forum.java.sun.com/thread.jspa?threadID=5148690&tstart=0]cross-post[/url] didn't mention an oracle database.
> You are an obstinate twit. That might be because the
> first post of your
> [url=http://forum.java.sun.com/thread.jspa?threadID=51
> 48690&tstart=0]cross-post[/url] didn't mention an
> oracle database.
and what about you? even you don't know in which thread you are replying!!you are talking in http://forum.java.sun.com/thread.jspa?threadID=5147584
Where are you?
> > You are an obstinate twit. That might be because
> the
> > first post of your
> >
> [url=http://forum.java.sun.com/thread.jspa?threadID=51
>
> > 48690&tstart=0]cross-post[/url] didn't mention an
> > oracle database.
>
> and what about you? even you don't know in which
> thread you are replying!!you are talking in
> http://forum.java.sun.com/thread.jspa?threadID=5147584
>
> Where are you?
Good job junior wait to bite the hand that feeds you.
> KevJava and Sabre150:
> You have not read my first post and talking a lot
> just for none.
I read it several times.
>
> Please read my post that when am inserting data into
> oracle db it encodes well but when am decoding to
> display from my db it doesn't decode in origional
> shape from db.
But you did not say you were displaying it through a JSP!
>
> this is my problem
Your problem is that you are an ignorant shite.
> Didn't your mother ever teach you to say "please"> when you're asking> someone to do you a favour?I sure taught his mother how to say "please" last night.Harharharhar!!Message was edited by: bckrispi
> and what about you? even you don't know in which
> thread you are replying!!you are talking in
> http://forum.java.sun.com/thread.jspa?threadID=5147584
>
>
> Where are you?
Wow. I really wish there was an "Ignore" or "Label as twit" feature on this board now.
> Wow. I really wish there was an "Ignore" or "Label> as twit" feature on this board now.facing truth is very hard
> > Wow. I really wish there was an "Ignore" or
> "Label
> > as twit" feature on this board now.
>
> facing truth is very hard
Now you are just trolling. No person can be this stupid to misunderstand that and still have the ability to breath.
> You are a piece of ungrateful sh1t! I had to
> guess what your real problem was because you seemed
> determined that it was a Base64 problem when it was
> nothing to do with Base64.
Unfortunately the OP first asked this question in the JDBC forum. (On the grounds that the data was being read from a database or something, I guess.) Some idiot suggested encoding the data with Base64, which to you or me is obviously ridiculous. But the OP seems bound and determined to do that anyway.
The problem is that the OP doesn't know anything. Now we have frustrated people answering the cross-posts all over the forum and getting nowhere because the OP doesn't have the background to understand any of the answers. Might as well just give it up.
> > Didn't your mother ever teach you to say "please"
> > when you're asking someone to do you a favour?
>
> I sure taught his mother how to say "please" last night.
>
> Harharharhar!!
Men ... *sigh* ... they're all dawgs I'm telling ya! With their football and
sixpacks and leaving all their dirty clothes all over the place. Men never
grow up; *sigh* ...
kind regards,
Loretta
JosAHa at 2007-7-21 18:17:30 >

> > > Didn't your mother ever teach you to say
> "please"
> > > when you're asking someone to do you a favour?
> >
> > I sure taught his mother how to say "please"
> last night.
> >
> > Harharharhar!!
>
> Men ... *sigh* ... they're all dawgs I'm telling ya!
> With their football and
> sixpacks and leaving all their dirty clothes all over
> the place. Men never
> grow up; *sigh* ...
>
> kind regards,
>
> Loretta
always said please but there is nobody who can favor
> Unfortunately the OP first asked this question in the
> JDBC forum. (On the grounds that the data was being
> read from a database or something, I guess.)
--
Its mean you didn't even seen the actual thread and came
>Some
> idiot suggested encoding the data with Base64, which
> to you or me is obviously ridiculous. But the OP
> seems bound and determined to do that anyway.
>
without knowing the actual problem you are saying your professional brothers ideot! how its pitty
> The problem is that the OP doesn't know anything. Now
> we have frustrated people answering the cross-posts
> all over the forum and getting nowhere because the OP
> doesn't have the background to understand any of the
> answers. Might as well just give it up.
without knowing anything you are just supposing everything and talking in the year
I regard all the professionals but request please please be polite
thanks
> thanksHere's a tip: create another account name because you certainly blewit with this one. I too found you quite demanding and quite unclear inyour problem descriptions (reread your own threads and see for yourself).kind regards,Jos
JosAHa at 2007-7-21 18:17:30 >

> > thanks
>
> Here's a tip: create another account name because you
> certainly blew
> it with this one. I too found you quite demanding and
> quite unclear in
> your problem descriptions (reread your own threads
> and see for yourself).
>
> kind regards,
>
> Jos
I don't think there is any truer proof of trolldom than having gotten cross-ways with Jos :).
> I don't think there is any truer proof of trolldom> than having gotten cross-ways with Jos :).Don't pay any attention to me; I'm such a naive puppy ;-)kind regards,Jos
JosAHa at 2007-7-21 18:17:31 >
