Procuring digital preservation CAN be quick and painless with our new dynamic...
Ojdbc
1. ORACLE JDBC IntroORACLE JDBC Intronstructor Art Saucedonstructor Art Saucedo
Brookfield 2016Brookfield 2016
UsingUsing
NetBeansNetBeans
2.
3. package javaapplication2;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author oradba
*/
import java.sql.*;
public class TestCallableStatement {
//** creates new form TestlableEditor **//
public static void main(String[] args) throws Exception {
Class.forName("oracle.jdbc.OracleDriver");
Connection connection = DriverManager.getConnection(
"jdbc:oracle:thin:@127.0.0.1:1522:XE", "system", "welcome1");
// Create a scallable statement
CallableStatement callableStatement = connection.prepareCall(
"{? = call studentFound(?,?) }"
);
4. java.util.Scanner input = new java.util.Scanner(System.in);
System.out.print("Enter Student's First Name: ");
String firstName = input.nextLine();
System.out.print("Enter Student's Last Name: ");
String lastName = input.nextLine();
callableStatement.setString(firstName, firstName);
callableStatement.setString(lastName, lastName);
callableStatement.registerOutParameter(1, Types.INTEGER);
callableStatement.execute();
if (callableStatement.getInt(1) >= 1) {
System.out.println(firstName + " " + lastName + "is in the database");
} else {
System.out.println(firstName + " " + lastName + "is not in the database");
}
}
}
5. Detected Java version: 1.8 in: /usr/jdk/instances/jdk1.8.0_91/jre
Detected OS: Linux
Trying to override old definition of task java
Trying to override old definition of task input
parsing buildfile jar:file:/home/oradba/netbeans-8.1/mobility/ant/nblib/org-netbeans-modules-j2me-
keystore.jar!/org/netbeans/modules/j2me/keystore/antlib.xml with URI = jar:file:/home/oradba/netbeans-8.1/mobility/ant/nblib/org-
netbeans-modules-j2me-keystore.jar!/org/netbeans/modules/j2me/keystore/antlib.xml from a zip file
parsing buildfile jar:file:/home/oradba/netbeans-8.1/extide/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI =
jar:file:/home/oradba/netbeans-8.1/extide/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
parsing buildfile jar:file:/home/oradba/netbeans-8.1/mobility/ant/nblib/org-netbeans-modules-j2me-
keystore.jar!/org/netbeans/modules/j2me/keystore/antlib.xml with URI = jar:file:/home/oradba/netbeans-8.1/mobility/ant/nblib/org-
netbeans-modules-j2me-keystore.jar!/org/netbeans/modules/j2me/keystore/antlib.xml from a zip file
parsing buildfile jar:file:/home/oradba/netbeans-8.1/java/ant/nblib/org-netbeans-modules-debugger-jpda-
ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/home/oradba/netbeans-8.1/java/ant/nblib/org-
netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml from a zip file
parsing buildfile jar:file:/home/oradba/netbeans-8.1/java/ant/nblib/org-netbeans-modules-debugger
Oracle JDBCOracle JDBC
TraceCompilerTraceCompilerBrookfield 2016 Instructor Art SaucedoBrookfield 2016 Instructor Art Saucedo
6. Collections in JAVACollections in JAVABrookfield 2016 Instructor Art SaucedoBrookfield 2016 Instructor Art Saucedo
ENDEND