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

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

1 Expert Approved Answer
Step: 1 Unlock

Dim conn As New OracleConnection Dim cmdQuery As String connConnectionString User I... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

613-CS-DB (1909).docx

120 KBs Word File

Students Have Also Explored These Related Databases Questions!