Skip to main content

Posts

java project using CMD Source Code Download

java project using CMD Source Code Download import java.sql.*; import java.*; import java.io.*; class whileInfinite { public static void main(String s[]) {  try{ while(true) { System.out.println("Select Your Choice :"); System.out.println("________________________________________"); System.out.println("1. Insert record :"); System.out.println("2. disply all records :"); System.out.println("3. display Specific record :"); System.out.println("4. update record:"); System.out.println("5. delete Record:"); System.out.println("6. Exit:"); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));           System.out.println("Enter your choice"); int choice = Integer.parseInt(reader.readLine()); System.out.println("yo entered"+ choice); switch(choice) { case 1:whileInfinite obj=new whileInfin...

accept value from user using bufffered reader and insert into msaccess database

accept value from user using buffered reader and insert into ms access database import java.sql.*; import java.io.*; class BufferedInsert { public static void main(String s[]) { try {              BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));              // it is used to accept value runtime System.out.println("Enter The name"); String nm = reader.readLine();  System.out.println("Enter The ID");     int id = Integer.parseInt(reader.readLine()); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //driver load             Connection con=DriverManager.getConnection("jdbc:odbc:demodb"); // connection             PreparedStatement psmt=con.prepareStatement("insert into demo(id,dname)values(?,?)"); psmt.setInt(1,id); psmt.setString(2,nm); ...

java program insert record using PreparedStatement

java program insert  record  using  PreparedStatement java MS ACCESS  insert,update  delete using  PreparedStatement import java.sql.*; class InsertPs { public static void main(String s[]) { try{ int id=Integer.parseInt(s[0]); String nm=s[1]; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:demodb"); PreparedStatement psmt=con.prepareStatement("insert into demo(id,dname)values(?,?)"); psmt.setInt(1,id); psmt.setString(2,nm); int result=psmt.executeUpdate(); System.out.println("record Inserted"+result); con.close(); } catch(Exception e) {System.out.println(""+e);} } } Learn Delete record from MS ACCESS USING PREPAIRED STATEMENT CLICK HERE insert query in java using prepared statement how to insert values into table in mysql using java how to use prep...

java MS ACCESS insert,update delete using PreparedStatement

java program delete record from table using  PreparedStatement java MS ACCESS  insert,update  delete using  PreparedStatement import java.sql.*; class DeletePreparest {   public static void main(String s[])   {     try {   int cno=Integer.parseInt(s[0]);  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  Connection con=DriverManager.getConnection("jdbc:odbc:demodb"); // Statement smt=con.createStatement();  PreparedStatement psmt=con.prepareStatement("delete from demo where id=?");  psmt.setInt(1,cno);  int result=psmt.executeUpdate();       System.out.println("record deleted"+result);  con.close(); } catch(Exception e){    System.out.println("exce"+e);}         } }

java ms access connectivity

java ms access connectivity java ms access connectivity Step by Step jdbc odbc driver for ms access java database connectivity with ms access 2007 java ms access connectivity steps how to connect java with ms access 2007 database with an example how to connect ms access database in java without dsn how to connect ms access database in java without using dsn Hi Friends in this article i am using ms access 2007 database as a back end, using java simple code we will connect to emp database created in ms access , after connecting with emp we are going to perform operation like display records from emp using java simple code, add record to emp using java simple code, delete record from emp using java simple code , update /edit emp using java simple code , i am using simple because vary basic code you found here . follow steps you can watch video or download PDF very Soon  for this article .  First  Create Table  use MS ACCESS 2007 or later as shown in imag...

how to write text file using java

welcome java file handling tutorial . in this tutorial we are going to wrie text file using  java here i have used Filewirter to write . use following steps to read text file using java  program 1. create one folder on d drive as f that is name of folder is f 2. create demo.txt file to write on it using program 3. create java program use following code or follow steps from video save java program in same folder import java.io.* package properly in java program 4. compile program and run 5. to understand program read what is FileReader read program explanation given below. // Program by Prakash Sonar import java.io.*; class jWrite { public static void main(String s[]) { try{ FileWriter w=new FileWriter("demo.txt",true); w.write("welcome to Prakash Programming Tutorial"); w.write("\n "); w.write("Thanks for Watching"); w.close(); } catch(Exception e){} } ...

java program to read file line by line

lets learn how to write java  program to read file line by line code is given below follow the steps from video import java.io.*; // program by Prakash Sonar class JfReadLine {   public static void main(String s[])   {     try {  FileReader r=new FileReader("t2.txt");  BufferedReader br=new BufferedReader(r);  String line;  while((line=br.readLine())!=null)  {  System.out.println(line);  } r.close(); } catch( Exception e) { }   } }

Labels

Show more