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
🚀 GOOGLE AI PRO 18 MONTHS ACTIVATION 🚀
sayuru bandara
Updated:
Today 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
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
May 30, 2026
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
How to connect Access 2007 Database in a Java Program, with a Password
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="sandaruwanchanaka" data-source="post: 11704563" data-attributes="member: 117828"><p>Java Program එකකට කොහොමද Access 2007 හදපු DB එකක් Connect කරලා, පාස්වර්ඩ් එකක්දෙන්නෙ? ඩේටාබෙස් එකේ පාස්වර්ඩ් එක.. </p><p></p><p>පාස්වර්ඩ් නැතුව එකක් හැදුවා.. පොඩ්ඩක් බලන්න... මේකට තමයි Password ඕන...</p><p></p><p></p><p>[CODE]</p><p>package javaapplication1;</p><p></p><p>import java.sql.*;</p><p></p><p>public class JavaApplication1 {</p><p></p><p> public static void main(String[] args){</p><p> // TODO code application logic here</p><p> </p><p> try {</p><p> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");</p><p> </p><p> String url = "jdbc:odbc:Driver={Microsoft Access Driver " +</p><p> "(*.mdb, *.accdb)};DBQ=C:\\BBB\\Database11.accdb"; // Installing Driver and Pointing DB</p><p> </p><p> Connection con = DriverManager.getConnection(url);</p><p> </p><p> System.out.println("Connected!");</p><p> </p><p> Statement stmt =null ;</p><p> </p><p> String SQL = "INSERT INTO Names(ID,first_name,last_name) VALUES ('4','s3cv','k2amala')";</p><p> </p><p> stmt = con.createStatement();</p><p></p><p> int i = stmt.executeUpdate(SQL);</p><p> </p><p> if (i != 0){ </p><p> System.out.println("Data update succeded");</p><p> }</p><p> else</p><p> System.out.println("Data update error");</p><p> </p><p> </p><p> con.close();</p><p> } catch (SQLException e) {</p><p> </p><p> System.out.println("SQL Exception: "+ e.toString());</p><p> </p><p> } catch (ClassNotFoundException cE) {</p><p> System.out.println("Class Not Found Exception: "+</p><p> cE.toString());</p><p> }</p><p> </p><p> // SQL INSERT command</p><p> </p><p> }</p><p>}</p><p></p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="sandaruwanchanaka, post: 11704563, member: 117828"] Java Program එකකට කොහොමද Access 2007 හදපු DB එකක් Connect කරලා, පාස්වර්ඩ් එකක්දෙන්නෙ? ඩේටාබෙස් එකේ පාස්වර්ඩ් එක.. පාස්වර්ඩ් නැතුව එකක් හැදුවා.. පොඩ්ඩක් බලන්න... මේකට තමයි Password ඕන... [CODE] package javaapplication1; import java.sql.*; public class JavaApplication1 { public static void main(String[] args){ // TODO code application logic here try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:Driver={Microsoft Access Driver " + "(*.mdb, *.accdb)};DBQ=C:\\BBB\\Database11.accdb"; // Installing Driver and Pointing DB Connection con = DriverManager.getConnection(url); System.out.println("Connected!"); Statement stmt =null ; String SQL = "INSERT INTO Names(ID,first_name,last_name) VALUES ('4','s3cv','k2amala')"; stmt = con.createStatement(); int i = stmt.executeUpdate(SQL); if (i != 0){ System.out.println("Data update succeded"); } else System.out.println("Data update error"); con.close(); } catch (SQLException e) { System.out.println("SQL Exception: "+ e.toString()); } catch (ClassNotFoundException cE) { System.out.println("Class Not Found Exception: "+ cE.toString()); } // SQL INSERT command } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom