Question: Rewrite the example shown in Figure 8-5 using VB.NET. import java.sql.*; public class TestJDBC { public static void main(String[] args) { try { Driverd =
Rewrite the example shown in Figure 8-5 using VB.NET.
![import java.sql.*; public class TestJDBC { public static void main(String[] args) { try { Driverd = (Driver)Class.forNam](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1552/4/7/9/9215c88f6b1b04461552479920334.jpg)
import java.sql.*; public class TestJDBC { public static void main(String[] args) { try { Driverd = (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newlnstance( ); System.out.println(d); DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver( );L Connection conn = Register the driver to be used. Identify the type of driver to be used. DriverManager.getConnection ("jdbc:oracle:thin:@durga.uits.indiana.edu:1 521:OED1", args[O], args[1]); Open a connection to a database. Create a Statement variable that can Statement st = conn.createStatement( ; < ResultSet rec = st.executeQuery("SELECT * FROM Student"); while(rec.next( )) { System.out.println(rec.getString("name"):) conn.close( ); < be used to issue queries against the database Issue a query and get a result. catch (Exception e) { System.out.printin("Error " + e); Process the result, one row at a time. Close the connection.
Step by Step Solution
3.51 Rating (161 Votes )
There are 3 Steps involved in it
Dim conn As New OracleConnection Dim cmdQuery As String connConnectionString User I... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
613-CS-DB (1909).docx
120 KBs Word File
