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
Colombo
Kaduwela - Two Storey House for Sale
dilrasan
Updated:
Today at 2:23 PM
Ad icon
Wechat qr verification
Pawan2005
Updated:
Today at 1:28 AM
🚀 GOOGLE AI PRO 18 MONTHS ACTIVATION 🚀
sayuru bandara
Updated:
Yesterday at 5:34 PM
Pure VPN - Up to 27 Months
vgp
Updated:
Friday at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Jun 2, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
java help needed
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="Jack_Sparrow" data-source="post: 7284794" data-attributes="member: 106688"><p><strong>java help needed</strong></p><p><strong></strong></p><p><strong>java karana kawuru hari gawa tiyanawada MYSQL Db ekata connect karala tiyana</strong></p><p><strong>java interface ekka tiyana sample ekak <img src="/styles/default/xenforo/smilies/default/happy.gif" class="smilie" loading="lazy" alt=":)" title="Happy :)" data-shortname=":)" /></strong></p><p><strong></strong></p><p><strong><img src="http://i43.tinypic.com/a0uvd1.jpg" alt="" class="fr-fic fr-dii fr-draggable " style="" /></strong></p><p><strong></strong></p><p><strong>meka mama wizard eka hadapu ekak meka wedak ne</strong></p><p><strong>mata oni mee wage connect strings dala hadapuekak</strong></p><p><strong></strong>[CODE]</p><p>[COLOR=#7f0055][B]import [/B][/COLOR][COLOR=#000000]java.sql.*;[/COLOR]</p><p></p><p>[COLOR=#7f0055][B]public class [/B][/COLOR][COLOR=#000000]GetAllRows[/COLOR][COLOR=#000000]{[/COLOR]</p><p>[COLOR=#7f0055][B]public static [/B][/COLOR][COLOR=#7f0055][B]void [/B][/COLOR][COLOR=#000000]main[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]String[/COLOR][COLOR=#000000][] [/COLOR][COLOR=#000000]args[/COLOR][COLOR=#000000]) {[/COLOR]</p><p>[COLOR=#000000]System.out.println[/COLOR][COLOR=#000000]([/COLOR][COLOR=#2a00ff]"Getting All Rows from a table!"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]Connection con = [/COLOR][COLOR=#7f0055][B]null[/B][/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]String url = [/COLOR][COLOR=#2a00ff]"jdbc:mysql://localhost:3306/"[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]String db = [/COLOR][COLOR=#2a00ff]"jdbctutorial"[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]String driver = [/COLOR][COLOR=#2a00ff]"com.mysql.jdbc.Driver"[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]String user = [/COLOR][COLOR=#2a00ff]"root"[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]String pass = [/COLOR][COLOR=#2a00ff]"root"[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#7f0055][B]try[/B][/COLOR][COLOR=#000000]{[/COLOR]</p><p>[COLOR=#000000]Class.forName[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]driver[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000].newInstance[/COLOR][COLOR=#000000]()[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]con = DriverManager.getConnection[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]url+db, user, pass[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#7f0055][B]try[/B][/COLOR][COLOR=#000000]{[/COLOR]</p><p>[COLOR=#000000]Statement st = con.createStatement[/COLOR][COLOR=#000000]()[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]ResultSet res = st.executeQuery[/COLOR][COLOR=#000000]([/COLOR][COLOR=#2a00ff]"SELECT * FROM employee6"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]System.out.println[/COLOR][COLOR=#000000]([/COLOR][COLOR=#2a00ff]"Emp_code: " [/COLOR][COLOR=#000000]+ [/COLOR][COLOR=#2a00ff]"\t" [/COLOR][COLOR=#000000]+ [/COLOR][COLOR=#2a00ff]"Emp_name: "[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#7f0055][B]while [/B][/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]res.next[/COLOR][COLOR=#000000]()) {[/COLOR]</p><p>[COLOR=#7f0055][B]int [/B][/COLOR][COLOR=#000000]i = res.getInt[/COLOR][COLOR=#000000]([/COLOR][COLOR=#990000]"Emp_code"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]String s = res.getString[/COLOR][COLOR=#000000]([/COLOR][COLOR=#990000]"Emp_name"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]System.out.println[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]i + [/COLOR][COLOR=#2a00ff]"\t\t" [/COLOR][COLOR=#000000]+ s[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]}[/COLOR]</p><p>[COLOR=#000000]con.close[/COLOR][COLOR=#000000]()[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]}[/COLOR]</p><p>[COLOR=#7f0055][B]catch [/B][/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]SQLException s[/COLOR][COLOR=#000000]){[/COLOR]</p><p>[COLOR=#000000]System.out.println[/COLOR][COLOR=#000000]([/COLOR][COLOR=#2a00ff]"SQL code does not execute."[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]} [/COLOR]</p><p>[COLOR=#000000]}[/COLOR]</p><p>[COLOR=#7f0055][B]catch [/B][/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]Exception e[/COLOR][COLOR=#000000]){[/COLOR]</p><p>[COLOR=#000000]e.printStackTrace[/COLOR][COLOR=#000000]()[/COLOR][COLOR=#000000];[/COLOR]</p><p>[COLOR=#000000]}[/COLOR]</p><p>[COLOR=#000000]}[/COLOR]</p><p>[COLOR=#000000]}[/COLOR]</p><p>[/CODE]<strong></strong></p><p><strong></strong></p><p><strong>mehcchara dewal onet nee text boxes tikai ADD , UPDATE , DELETE buttons tibbama ethi</strong></p><p><strong>tiyanwanam upload karanna <img src="/styles/default/xenforo/smilies/default/D.gif" class="smilie" loading="lazy" alt=":D" title="Big grin :D" data-shortname=":D" /> </strong></p><p><strong>thanks </strong></p><p><strong></strong></p><p><strong>//////////////////////////</strong></p><p><strong>EDITED--------------</strong></p><p> <strong></strong></p><p><strong>ethi yantham me tika karagatta </strong></p><p> <strong>udaw karanna try karapu aya and udaw karapy miyaru, geethq ta thanks wewa <img src="/styles/default/xenforo/smilies/default/D.gif" class="smilie" loading="lazy" alt=":D" title="Big grin :D" data-shortname=":D" /> </strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p></blockquote><p></p>
[QUOTE="Jack_Sparrow, post: 7284794, member: 106688"] [B]java help needed java karana kawuru hari gawa tiyanawada MYSQL Db ekata connect karala tiyana java interface ekka tiyana sample ekak :) [IMG]http://i43.tinypic.com/a0uvd1.jpg[/IMG] meka mama wizard eka hadapu ekak meka wedak ne mata oni mee wage connect strings dala hadapuekak [/B][CODE] [COLOR=#7f0055][B]import [/B][/COLOR][COLOR=#000000]java.sql.*;[/COLOR] [COLOR=#7f0055][B]public class [/B][/COLOR][COLOR=#000000]GetAllRows[/COLOR][COLOR=#000000]{[/COLOR] [COLOR=#7f0055][B]public static [/B][/COLOR][COLOR=#7f0055][B]void [/B][/COLOR][COLOR=#000000]main[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]String[/COLOR][COLOR=#000000][] [/COLOR][COLOR=#000000]args[/COLOR][COLOR=#000000]) {[/COLOR] [COLOR=#000000]System.out.println[/COLOR][COLOR=#000000]([/COLOR][COLOR=#2a00ff]"Getting All Rows from a table!"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]Connection con = [/COLOR][COLOR=#7f0055][B]null[/B][/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]String url = [/COLOR][COLOR=#2a00ff]"jdbc:mysql://localhost:3306/"[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]String db = [/COLOR][COLOR=#2a00ff]"jdbctutorial"[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]String driver = [/COLOR][COLOR=#2a00ff]"com.mysql.jdbc.Driver"[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]String user = [/COLOR][COLOR=#2a00ff]"root"[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]String pass = [/COLOR][COLOR=#2a00ff]"root"[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#7f0055][B]try[/B][/COLOR][COLOR=#000000]{[/COLOR] [COLOR=#000000]Class.forName[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]driver[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000].newInstance[/COLOR][COLOR=#000000]()[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]con = DriverManager.getConnection[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]url+db, user, pass[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#7f0055][B]try[/B][/COLOR][COLOR=#000000]{[/COLOR] [COLOR=#000000]Statement st = con.createStatement[/COLOR][COLOR=#000000]()[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]ResultSet res = st.executeQuery[/COLOR][COLOR=#000000]([/COLOR][COLOR=#2a00ff]"SELECT * FROM employee6"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]System.out.println[/COLOR][COLOR=#000000]([/COLOR][COLOR=#2a00ff]"Emp_code: " [/COLOR][COLOR=#000000]+ [/COLOR][COLOR=#2a00ff]"\t" [/COLOR][COLOR=#000000]+ [/COLOR][COLOR=#2a00ff]"Emp_name: "[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#7f0055][B]while [/B][/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]res.next[/COLOR][COLOR=#000000]()) {[/COLOR] [COLOR=#7f0055][B]int [/B][/COLOR][COLOR=#000000]i = res.getInt[/COLOR][COLOR=#000000]([/COLOR][COLOR=#990000]"Emp_code"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]String s = res.getString[/COLOR][COLOR=#000000]([/COLOR][COLOR=#990000]"Emp_name"[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]System.out.println[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]i + [/COLOR][COLOR=#2a00ff]"\t\t" [/COLOR][COLOR=#000000]+ s[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#000000]con.close[/COLOR][COLOR=#000000]()[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#7f0055][B]catch [/B][/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]SQLException s[/COLOR][COLOR=#000000]){[/COLOR] [COLOR=#000000]System.out.println[/COLOR][COLOR=#000000]([/COLOR][COLOR=#2a00ff]"SQL code does not execute."[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]} [/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#7f0055][B]catch [/B][/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]Exception e[/COLOR][COLOR=#000000]){[/COLOR] [COLOR=#000000]e.printStackTrace[/COLOR][COLOR=#000000]()[/COLOR][COLOR=#000000];[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR] [/CODE][B] mehcchara dewal onet nee text boxes tikai ADD , UPDATE , DELETE buttons tibbama ethi tiyanwanam upload karanna :D thanks ////////////////////////// EDITED-------------- ethi yantham me tika karagatta udaw karanna try karapu aya and udaw karapy miyaru, geethq ta thanks wewa :D [/B] [/QUOTE]
Insert quotes…
Verification
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom