Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
Sell your Land, House on idamata.lk for FREE
sajith.xp.pk
Updated:
Yesterday at 9:03 AM
Handmade Character Soft Toys
anil1961
Updated:
Tuesday at 2:11 PM
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Sunday at 3:05 AM
Power Lifting Lever Belt
SkullVamp
Updated:
Jun 13, 2026
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Jun 13, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
ElaKiri Programmer's Club
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Voltage" data-source="post: 17893193" data-attributes="member: 391265"><p><strong>Java | LoginForm</strong></p><p></p><p><strong><span style="color: Navy"><span style="font-size: 10px"><span style="color: DarkGreen"><span style="font-size: 15px"><strong>මචන්ලා </strong></span></span></span></span></strong></p><p><strong><span style="color: Navy"><span style="font-size: 10px">Java වලින් login form එකක් හදද්දි මං ඒකට පාවිච්චි කලේ JPasswordField එකක්. Db එකේ plain text වලින් password එක store කරන් නැති වෙන්න ඕන නිසා. save කලාම db එකේ encrypt වෙච්ච code එකක් වගේ මෙව්වා එකක් විදියට password එක save වෙනවා. ඒත් මම login form එකේ log වෙන code එකට password compare කරන්න try කලාට කරගන්න බෑනෙ. පොඩි help එකක් දෙනවද</span></span></strong></p><p><strong><span style="color: Navy"><span style="font-size: 10px"></span></span></strong></p><p><strong><span style="color: Navy"><span style="font-size: 10px"><u><span style="color: red">user ව save කරන code එක මම ලිවුවෙ මෙහෙම</span></u></span></span></strong><span style="color: Navy"><span style="font-size: 10px"></span></span></p><p><span style="color: Navy"><span style="font-size: 10px"></span></span></p><p><span style="font-size: 10px">[CODE] String userName = txtuname.getText();</span></p><p><span style="font-size: 10px"> String userType;</span></p><p><span style="font-size: 10px"> </span></p><p><span style="font-size: 10px"> if (JrAdmin.isSelected()) {</span></p><p><span style="font-size: 10px"> userType = "Admin";</span></p><p><span style="font-size: 10px"> } else if (JrCash.isSelected()) {</span></p><p><span style="font-size: 10px"> userType = "Cashier";</span></p><p><span style="font-size: 10px"> }else userType = "Owner";</span></p><p><span style="font-size: 10px"> </span></p><p><span style="font-size: 10px"> db.setData("INSERT INTO users VALUES('"+txtuid.getText()+"','"+userName+"','"+userType+"','"+txtupass.getPassword()+"')");[/CODE]</span></p><p></p><p><u><span style="font-size: 10px"><strong><span style="color: Red">login code එක මෙහෙම</span></strong></span></u><span style="font-size: 10px"></span></p><p><span style="font-size: 10px">[CODE]String uname = txtUserName.getText();</span></p><p><span style="font-size: 10px"> String pass = new String(txtPassword.getPassword());</span></p><p><span style="font-size: 10px"> </span></p><p><span style="font-size: 10px"> </span></p><p><span style="font-size: 10px"> ResultSet userset = db.getData("Select * from users where user_name='"+uname+"' and user_pw='"+pass+"'");</span></p><p><span style="font-size: 10px"> if(userset.next()) {</span></p><p><span style="font-size: 10px"> </span></p><p><span style="font-size: 10px"> dispose();</span></p><p><span style="font-size: 10px"> new mainUI().setVisible(true); [/CODE]</span></p><p></p><p><span style="font-size: 10px"><strong><span style="color: DarkRed">database එකේ password එකට යන data type එක VARCHAR වලට දැම්මොත් නම් ඔය code එක වැඩ කරනවා. ඒත් plain text තියන එක අවුල් නිසා එකට මොකද්ද මචන්ලා කරන්න ඕන. database එකේ password එක තියන්න හොද මොන data type එකෙන්ද <img src="/styles/default/xenforo/smilies/default/sorry.gif" class="smilie" loading="lazy" alt=":sorry:" title="Sorry :sorry:" data-shortname=":sorry:" /></span></strong></span></p></blockquote><p></p>
[QUOTE="Voltage, post: 17893193, member: 391265"] [b]Java | LoginForm[/b] [B][COLOR="Navy"][SIZE="2"][COLOR="DarkGreen"][SIZE="4"][B]මචන්ලා [/B][/SIZE][/COLOR] Java වලින් login form එකක් හදද්දි මං ඒකට පාවිච්චි කලේ JPasswordField එකක්. Db එකේ plain text වලින් password එක store කරන් නැති වෙන්න ඕන නිසා. save කලාම db එකේ encrypt වෙච්ච code එකක් වගේ මෙව්වා එකක් විදියට password එක save වෙනවා. ඒත් මම login form එකේ log වෙන code එකට password compare කරන්න try කලාට කරගන්න බෑනෙ. පොඩි help එකක් දෙනවද [U][COLOR="red"]user ව save කරන code එක මම ලිවුවෙ මෙහෙම[/COLOR][/U][/SIZE][/COLOR][/B][COLOR="Navy"][SIZE="2"][U][COLOR="red"][/COLOR][/U] [/SIZE][/COLOR] [SIZE="2"][CODE] String userName = txtuname.getText(); String userType; if (JrAdmin.isSelected()) { userType = "Admin"; } else if (JrCash.isSelected()) { userType = "Cashier"; }else userType = "Owner"; db.setData("INSERT INTO users VALUES('"+txtuid.getText()+"','"+userName+"','"+userType+"','"+txtupass.getPassword()+"')");[/CODE][/SIZE] [U][SIZE="2"][B][COLOR="Red"]login code එක මෙහෙම[/COLOR][/B][/SIZE][/U][SIZE="2"] [CODE]String uname = txtUserName.getText(); String pass = new String(txtPassword.getPassword()); ResultSet userset = db.getData("Select * from users where user_name='"+uname+"' and user_pw='"+pass+"'"); if(userset.next()) { dispose(); new mainUI().setVisible(true); [/CODE][/SIZE] [SIZE="2"][B][COLOR="DarkRed"]database එකේ password එකට යන data type එක VARCHAR වලට දැම්මොත් නම් ඔය code එක වැඩ කරනවා. ඒත් plain text තියන එක අවුල් නිසා එකට මොකද්ද මචන්ලා කරන්න ඕන. database එකේ password එක තියන්න හොද මොන data type එකෙන්ද :sorry:[/COLOR][/B][/SIZE] [/QUOTE]
Insert quotes…
Verification
Nawa warak dahaya keeyada? (Namaya wadi kireema dahaya)
Post reply
Top
Bottom