Write java program shows the connection is established to java – oracle using jdbc
import java.sql.*;
public class Abc { public static void main(String args[])throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); System.out.println("driver Loaded"); String str = "jdbc:odbc:nacdsn"; String un = "system"; String pw = "tiger"; Connection con = DriverManager.getConnection(str,un,pw); if(con!=null) System.out.println("Connection established"); else System.out.println("connection not established"); } } |