Searched for ""

How to Create Table in Oracle Using statement in Java

import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.Scanner; /* * Here we will learn to Create Table in DB using JDBC Statements in Oracle and MySQL DB */ public class CreateTableWithStatement { public static void main(String[] args) { String tableCreateQuery = "create table JBT(name varchar2(10), course varchar2(10))"; Statement statement = null; Connection connection… Continue reading

How to connect to mysql database in java

Here we will learn to connect to MYSQL DB via Java. import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Scanner; /* * Here we will learn to connect to Oracle DB using JDBC Driver. */ public class ConnectMySQLDB { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out .println("Please provide below details to… Continue reading

How to read a File using Scanner Class

Here we are discussing about reading the file using Scanner. To learn to read File using BufferedInputStream  Click Here. package JavaIOExample; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; /* * Here we will learn to read the file using Scanner. */ public class ReadTheFileUsingScanner { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("Enter the… Continue reading

How to read a File using BufferedInputStream

Here we are discussing about reading the file using BufferedInputStream. To learn to read File using Scanner  Click Here. package JavaIOExample; import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Scanner; /* * Here we will learn to read the file using BufferedInputStream. */ public class ReadTheFileUsingBufferedInputStream { @SuppressWarnings("deprecation") public static void… Continue reading