Database Connectivity

import javax.swing.JOptionPane;
import java.sql.*;
public class JDBCCreateTable{

static String userid=”scott”, password = “tiger”;
static String url = “jdbc:odbc:bob”;    // String url = “jdbc:mySubprotocol:myDataSource”; ?
static Statement stmt;
static Connection con;
public static void main(String args[]){

JOptionPane.showMessageDialog(null,”JDBC Programming showing Creation of Table’s”);
int choice = -1;

do{
choice = getChoice();
if (choice != 0){
getSelected(choice);
}
}
(more…)

Advertisements