• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

char to binary

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i have problem updating char to binary, is like when i enter 123 it save on the database like this 100000000200000000300000000
below is the code





thanks
-roy
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roy,

Why don't you try using executeUpdate instead of executeQuery.

Regards,

Fatih.

Edit: Typo corrected
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roy,

can you please share what is (not) happening, and the error codes you get?

(by the way, storing passwords as a binary value is not a strong security measure. It is way too easy to revert. It is virtualy the same as just storing the plain text string.)

Regards, Jan
 
roy ramos
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Fatih,

thanks for suggestion will try that

Hi Jan,

Im expecting that the binary will be saved like 123000000000000, no error codes, what do you suggest on how to store the password, im still newbie on programming

thanks,
-roy
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use any one of encoding techniques like base64 encoding
 
roy ramos
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Priya dharshini wrote:you can use any one of encoding techniques like base64 encoding



hi Priya,

if the password is already encrypt using md5 and saved in the database, during login how can i compare if it's same with the user entered password with the data that was encrypt in md5 ? can anybody show me a sample code during user login

thanks,
-roy
 
Ranch Hand
Posts: 45
Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Encrypt the password entered by user same way and compare it with one saved in daabase.Or decrypt the password from database and compare it with the one user entered.
 
roy ramos
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Smitesh Shinde wrote:Encrypt the password entered by user same way and compare it with one saved in daabase.Or decrypt the password from database and compare it with the one user entered.



Thanks Smitesh got it
 
No more fooling around. Read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic