Using a swing program with a gui-based jdbc program

hello.
my name is james mcfadden and i am a final year computing student at letterkenny IT in ireland. i have 2 programs here that i want to make interact with each other. the first one is a jdbc demo and the second one is a login program that i'll be using with the first one. i was trying to get the 2 programs interacting with each other yesterday but i was unsuccessful. would you be able to look at it as soon as possible? i have to be able to use these programs next week. thank you very much.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.JOptionPane;
import java.sql.*;
public class Demo extends JFrame {
static String url = "jdbc:odbc:VideoLibrary";
static Statement stmt;
static Connection con;
     //declare member variables here
     JTextField hostField;
JTextField queryField;
QueryTableModel qtm;
JComboBox comboBox;
public static void main(String args[]){
     //new LogOn();     
int choice=-1;
          do{
choice=getChoice();
if(choice!=0){
getSelected(choice);
}while(choice!=5);
System.exit(0);
public static int getChoice(){
String choice;
int ch;
choice = JOptionPane.showInputDialog(null,"1. Maintain product details\n"+"2. Maintain member details\n"+"3. Maintain rental details\n"+"4. View product, member and rental details\n"+"5. Log Off\n\n"+"Enter your choice");
          ch = Integer.parseInt(choice);
return ch;
public static void getSelected(int choice){   
          if(choice==1){
addProducts();
if(choice==2){
addMembers();
          if(choice==3){
addRentals();
          if(choice==4){
          Demo test = new Demo();
test.setVisible(true);
public static Connection getConnection(){
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
try {
con=DriverManager.getConnection(url,"","");
          catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
return con;
public static void addProducts(){
Connection con = getConnection();
String addProduct1, addProduct2, addProduct3, addProduct4, addProduct5, addProduct6, addProduct7, addProduct8, addProduct9, addProduct10, addProduct11, addProduct12, addProduct13, addProduct14, addProduct15, addProduct16, addProduct17, addProduct18, addProduct19, addProduct20, addProduct21, addProduct22, addProduct23, addProduct24, addProduct25, addProduct26, addProduct27, addProduct28, addProduct29, addProduct30, addProduct31, addProduct32, addProduct33, addProduct34, addProduct35, addProduct36, addProduct37, addProduct38, addProduct39, addProduct40, addProduct41, addProduct42, addProduct43, addProduct44, addProduct45, addProduct46, addProduct47, addProduct48, addProduct49, addProduct50, addProduct51, addProduct52, addProduct53, addProduct54, addProduct55, addProduct56, addProduct57, addProduct58, addProduct59, addProduct60, addProduct61, addProduct62, addProduct63, addProduct64, addProduct65, addProduct66, addProduct67, addProduct68, addProduct69, addProduct70, addProduct71, addProduct72, addProduct73, addProduct74, addProduct75, addProduct76, addProduct77, addProduct78, addProduct79, addProduct80, addProduct81, addProduct82, addProduct83, addProduct84, addProduct85, addProduct86, addProduct87, addProduct88, addProduct89, addProduct90, addProduct91, addProduct92, addProduct93;
addProduct1 = "insert into Product values (110001, 'The Killers - Sams Town', 5.00, 'G', 'CD', 2006)";
addProduct2 = "insert into Product values (110002, 'Robbie Williams - Rudebox', 5.00, 'G', 'CD', 2006)";
addProduct3 = "insert into Product values (110003, 'Razorlight - Razorlight', 5.00, 'G', 'CD', 2006)";
addProduct4 = "insert into Product values (110004, 'My Chemical Romance - The Black Parade', 5.00, 'G', 'CD', 2006)";
addProduct5 = "insert into Product values (110005, 'Snow Patrol - Eyes Open', 5.00, 'G', 'CD', 2006)";
addProduct6 = "insert into Product values (110006, 'Scissor Sisters - Ta-Dah!', 5.00, 'G', 'CD', 2006)";
          addProduct7 = "insert into Product values (110007, 'Lovesounds - Justin Timberlake', 5.00, 'G', 'CD', 2006)";
addProduct8 = "insert into Product values (110008, 'Director - We thrive on big cities', 5.00, 'G', 'CD', 2006)";
addProduct9 = "insert into Product values (110009, 'Roxette - Roxette hits', 5.00, 'G', 'CD', 2006)";
addProduct10 = "insert into Product values (110010, 'Pussy Cat Dolls - PCD', 5.00, 'G', 'CD', 2006)";
addProduct11 = "insert into Product values (110011, 'Evanescence - The Open Door', 5.00, 'G', 'CD', 2006)";
addProduct12 = "insert into Product values (110012, 'Deacon Blue - The Singles', 5.00, 'G', 'CD', 2006)";
          addProduct13 = "insert into Product values (110013, 'Rod Stewart - The Best of Rod Stewart', 5.00, 'G', 'CD', 2006)";
          addProduct14 = "insert into Product values (110014, 'P Diddy - Press Play', 5.00, 'G', 'CD', 2006)";
addProduct15 = "insert into Product values (110015, 'James Morrison - Undiscovered', 5.00, 'G', 'CD', 2006)";
addProduct16 = "insert into Product values (110016, 'BDay - Beyonce', 5.00, 'G', 'CD', 2006)";
addProduct17 = "insert into Product values (110017, 'John Legend - Once Again', 5.00, 'G', 'CD', 2006)";
          addProduct18 = "insert into Product values (110018, 'Luther Vandross - The Ultimate', 5.00, 'G', 'CD', 2006)";
          addProduct19 = "insert into Product values (110019, 'Fleetwood Mac - Greatest Hits', 5.00, 'G', 'CD', 2006)";
          addProduct20 = "insert into Product values (110020, 'Kooks - Inside In Inside Out', 5.00, 'G', 'CD', 2006)";
          addProduct21 = "insert into Product values (110021, 'Scooter - Mind the Gap', 5.00, 'G', 'CD', 2007)";
          addProduct22 = "insert into Product values (110022, 'Scooter - Whos Got the Last', 5.00, 'G', 'CD', 2007)";
          addProduct23 = "insert into Product values (110023, 'Scooter - Jigga Jigga', 5.00, 'G', 'CD', 2007)";
          addProduct24 = "insert into Product values (110024, 'Dr. Alban - Look Whos Talking', 5.00, 'G', 'CD', 2007)";
          addProduct25 = "insert into Product values (110025, 'Dr. Alban - Hello Afrika', 5.00, 'G', 'CD', 2007)";
          addProduct26 = "insert into Product values (110026, 'Dr. Alban - Born in Africa', 5.00, 'G', 'CD', 2007)";
          addProduct27 = "insert into Product values (110027, 'Bon Jovi - Crossroad', 5.00, 'G', 'CD', 2007)";
          addProduct28 = "insert into Product values (110028, 'Bon Jovi - Have a Nice Day', 5.00, 'G', 'CD', 2007)";
          addProduct29 = "insert into Product values (110029, 'Bon Jovi - These Days', 5.00, 'G', 'CD', 2007)";
          addProduct30 = "insert into Product values (120001, 'Mission Impossible 3', 5.00, '15', 'DVD', 2006)";
          addProduct31 = "insert into Product values (120002, 'The Wind that Shakes the Barley', 5.00, '12', 'DVD', 2006)";
          addProduct32 = "insert into Product values (120003, 'The Break Up', 5.00, '12', 'DVD', 2006)";
          addProduct33 = "insert into Product values (120004, 'The Da Vinci Code', 5.00, '15', 'DVD', 2006)";
          addProduct34 = "insert into Product values (120005, 'Ice Age 2', 5.00, 'G', 'DVD', 2006)";
          addProduct35 = "insert into Product values (120006, 'Just My Luck', 5.00, '12', 'DVD', 2006)";
          addProduct36 = "insert into Product values (120007, 'Stormbreaker', 5.00, '12', 'DVD', 2006)";
          addProduct37 = "insert into Product values (120008, 'X-Men 3', 5.00, 'PG', 'DVD', 2006)";
          addProduct38 = "insert into Product values (120009, 'Lake House', 5.00, '12', 'DVD', 2006)";
          addProduct39 = "insert into Product values (120010, 'Inside Man', 5.00, '15', 'DVD', 2006)";
          addProduct40 = "insert into Product values (120011, 'Ultraviolet', 5.00, '12', 'DVD', 2006)";
          addProduct41 = "insert into Product values (120012, 'Friends with Money', 5.00, '15', 'DVD', 2006)";
          addProduct42 = "insert into Product values (120013, 'Fearless', 5.00, 'PG', 'DVD', 2006)";
          addProduct43 = "insert into Product values (120014, 'When A Stranger Calls', 5.00, '15', 'DVD', 2006)";
          addProduct44 = "insert into Product values (120015, 'Prime', 5.00, '15', 'DVD', 2006)";
          addProduct45 = "insert into Product values (120016, 'Poseidon', 5.00, '12', 'DVD', 2006)";
          addProduct46 = "insert into Product values (120017, 'Tristan & Isolde', 5.00, '12', 'DVD', 2006)";
          addProduct47 = "insert into Product values (120018, 'Little Mermaid', 5.00, '12', 'DVD', 2006)";
          addProduct48 = "insert into Product values (120019, 'The Fast & The Furious 3', 5.00, '12', 'DVD', 2006)";
          addProduct49 = "insert into Product values (120020, 'The Omen', 5.00, '15', 'DVD', 2006)";
          addProduct50 = "insert into Product values (120021, 'Eragon', 5.00, '15', 'DVD', 2007)";
          addProduct51 = "insert into Product values (120022, 'Arthur and the Minimoys', 5.00, '15', 'DVD', 2007)";
          addProduct52 = "insert into Product values (120023, 'The Pursuit of Happyness', 5.00, 'G', 'DVD', 2007)";
          addProduct53 = "insert into Product values (120024, 'Van Wilder 2: The Rise of Taj', 5.00, '15', 'DVD', 2007)";
          addProduct54 = "insert into Product values (120025, 'Blood Diamond', 5.00, '15', 'DVD', 2007)";
          addProduct55 = "insert into Product values (120026, 'Deja Vu', 5.00, '15', 'DVD', 2007)";
          addProduct56 = "insert into Product values (120027, 'For Your Consideration', 5.00, '18', 'DVD', 2007)";
          addProduct57 = "insert into Product values (120028, 'The Fountain', 5.00, 'PG', 'DVD', 2007)";
          addProduct58 = "insert into Product values (120029, 'Bobby', 5.00, '15', 'DVD', 2007)";
          addProduct59 = "insert into Product values (130001, 'Need for Special Carbon', 5.00, '15', 'Playstation 2 Game', 2006)";
          addProduct60 = "insert into Product values (130002, 'Need for Special Carbon', 5.00, '15', 'Nintendo DS Game', 2006)";
          addProduct61 = "insert into Product values (130003, 'Need for Special Carbon', 5.00, '15', 'PSP Game', 2006)";
          addProduct62 = "insert into Product values (130004, 'Need for Special Carbon', 5.00, '15', 'Xbox 360 Game', 2006)";
          addProduct63 = "insert into Product values (130005, 'EYETOY Play SPORTS', 5.00, '15', 'Playstation 2 Game', 2006)";
          addProduct64 = "insert into Product values (130006, 'Family Fun With Playstation 2', 5.00, '15', 'Playstation 2 Game', 2006)";
          addProduct65 = "insert into Product values (130007, 'Smackdown v Raw 07', 5.00, '15', 'Playstation 2 Game', 2006)";
          addProduct66 = "insert into Product values (130008, 'Smackdown v Raw 07', 5.00, '15', 'PSP Game', 2006)";
          addProduct67 = "insert into Product values (130009, 'Smackdown v Raw 07', 5.00, '15', 'Xbox 360 Game', 2006)";
          addProduct68 = "insert into Product values (130010, 'Sinister Legends', 5.00, '15', 'Playstation 2 Game', 2006)";
          addProduct69 = "insert into Product values (130011, 'Pro Evolution Soccer 6', 5.00, '15', 'Playstation 2 Game', 2006)";
          addProduct70 = "insert into Product values (130012, 'Pro Evolution Soccer 6', 5.00, '15', 'PSP Game', 2006)";
          addProduct71 = "insert into Product values (130013, 'Pro Evolution Soccer 6', 5.00, '15', 'Xbox 360 Game', 2006)";
          addProduct72 = "insert into Product values (130014, 'BUZZ Jungle Party', 5.00, '15', 'Playstation 2 Game', 2006)";
          addProduct73 = "insert into Product values (130015, 'FIFA 07', 5.00, '15', 'Playstation 2 Game', 2006)";
          addProduct74 = "insert into Product values (130016, 'Killzone Liberation', 5.00, '15', 'PSP Game', 2006)";
          addProduct75 = "insert into Product values (130017, 'Gangs of London', 5.00, '15', 'PSP Game', 2006)";
          addProduct76 = "insert into Product values (130018, 'FIFA 07', 5.00, '15', 'PSP Game', 2006)";
          addProduct77 = "insert into Product values (130019, 'Passport to Amsterdam', 5.00, '15', 'PSP Game', 2006)";
          addProduct78 = "insert into Product values (130020, 'Tiger Woods 07', 5.00, '15', 'Playstation 2 Game', 2006)";
          addProduct79 = "insert into Product values (130021, 'Tiger Woods 07', 4.90, '15', 'PSP Game', 2006)";
          addProduct80 = "insert into Product values (130022, 'Tiger Woods 07', 4.90, '15', 'Xbox 360 Game', 2006)";
          addProduct81 = "insert into Product values (130023, 'Madden NFL 07', 4.90, '15', 'Playstation 2 Game', 2006)";
          addProduct82 = "insert into Product values (130024, 'Madden NFL 07', 4.90, '15', 'Nintendo DS Game', 2006)";
          addProduct83 = "insert into Product values (130025, 'Madden NFL 07', 4.90, '15', 'PSP Game', 2006)";
          addProduct84 = "insert into Product values (130026, 'Madden NFL 07', 4.90, '15', 'Xbox 360 Game', 2006)";
          addProduct85 = "insert into Product values (130027, 'Gears of War', 4.90, '15', 'Xbox 360 Game', 2006)";
          addProduct86 = "insert into Product values (130028, 'Star Trek: Legacy', 4.90, '15', 'Xbox 360 Game', 2006)";
          addProduct87 = "insert into Product values (130029, 'Tekken: Dark Ressurection', 4.90, '15', 'PSP Game', 2006)";
          addProduct88 = "insert into Product values (130030, 'GTA Vice city stories PSP', 4.90, '15', 'PSP Game', 2006)";
          addProduct89 = "insert into Product values (130031, 'Star Trek: Encounters', 5.00, '15', 'Playstation 2 Game', 2007)";
          addProduct90 = "insert into Product values (130032, 'Star Trek: Shattered Universe', 5.00, '15', 'Xbox 360 Game', 2007)";
          addProduct91 = "insert into Product values (130033, 'Star Trek Voyager: Elite Force', 5.00, '15', 'Playstation 2 Game', 2007)";
          addProduct92 = "insert into Product values (130034, 'Battlestar Galactica', 5.00, '15', 'Xbox 360 Game', 2007)";
          addProduct93 = "insert into Product values (130035, 'Battlestar Galactica', 5.00, '15', 'Playstation 2 Game', 2007)";
          try {
stmt = con.createStatement();
stmt.executeUpdate(addProduct1);
stmt.executeUpdate(addProduct2);
stmt.executeUpdate(addProduct3);
stmt.executeUpdate(addProduct4);
               stmt.executeUpdate(addProduct5);
stmt.executeUpdate(addProduct6);
          stmt.executeUpdate(addProduct7);
stmt.executeUpdate(addProduct8);
stmt.executeUpdate(addProduct9);
stmt.executeUpdate(addProduct10);
stmt.executeUpdate(addProduct11);
stmt.executeUpdate(addProduct12);
          stmt.executeUpdate(addProduct13);
          stmt.executeUpdate(addProduct14);
stmt.executeUpdate(addProduct15);
stmt.executeUpdate(addProduct16);
stmt.executeUpdate(addProduct17);
          stmt.executeUpdate(addProduct18);
          stmt.executeUpdate(addProduct19);
          stmt.executeUpdate(addProduct20);
          stmt.executeUpdate(addProduct21);
          stmt.executeUpdate(addProduct22);
          stmt.executeUpdate(addProduct23);
          stmt.executeUpdate(addProduct24);
          stmt.executeUpdate(addProduct25);
          stmt.executeUpdate(addProduct26);
          stmt.executeUpdate(addProduct27);
          stmt.executeUpdate(addProduct28);
          stmt.executeUpdate(addProduct29);
          stmt.executeUpdate(addProduct30);
          stmt.executeUpdate(addProduct31);
          stmt.executeUpdate(addProduct32);
          stmt.executeUpdate(addProduct33);
          stmt.executeUpdate(addProduct34);
          stmt.executeUpdate(addProduct35);
          stmt.executeUpdate(addProduct36);
          stmt.executeUpdate(addProduct37);
          stmt.executeUpdate(addProduct38);
          stmt.executeUpdate(addProduct39);
          stmt.executeUpdate(addProduct40);
          stmt.executeUpdate(addProduct41);
          stmt.executeUpdate(addProduct42);
          stmt.executeUpdate(addProduct43);
          stmt.executeUpdate(addProduct44);
          stmt.executeUpdate(addProduct45);
          stmt.executeUpdate(addProduct46);
          stmt.executeUpdate(addProduct47);
          stmt.executeUpdate(addProduct48);
          stmt.executeUpdate(addProduct49);
          stmt.executeUpdate(addProduct50);
          stmt.executeUpdate(addProduct51);
          stmt.executeUpdate(addProduct52);
          stmt.executeUpdate(addProduct53);
          stmt.executeUpdate(addProduct54);
          stmt.executeUpdate(addProduct55);
          stmt.executeUpdate(addProduct56);
          stmt.executeUpdate(addProduct57);
          stmt.executeUpdate(addProduct58);
          stmt.executeUpdate(addProduct59);
          stmt.executeUpdate(addProduct60);
          stmt.executeUpdate(addProduct61);
          stmt.executeUpdate(addProduct62);
          stmt.executeUpdate(addProduct63);
          stmt.executeUpdate(addProduct64);
          stmt.executeUpdate(addProduct65);
          stmt.executeUpdate(addProduct66);
          stmt.executeUpdate(addProduct67);
          stmt.executeUpdate(addProduct68);
          stmt.executeUpdate(addProduct69);
          stmt.executeUpdate(addProduct70);
          stmt.executeUpdate(addProduct71);
          stmt.executeUpdate(addProduct72);
          stmt.executeUpdate(addProduct73);
          stmt.executeUpdate(addProduct74);
          stmt.executeUpdate(addProduct75);
          stmt.executeUpdate(addProduct76);
          stmt.executeUpdate(addProduct77);
          stmt.executeUpdate(addProduct78);
          stmt.executeUpdate(addProduct79);
          stmt.executeUpdate(addProduct80);
          stmt.executeUpdate(addProduct81);
          stmt.executeUpdate(addProduct82);
          stmt.executeUpdate(addProduct83);
          stmt.executeUpdate(addProduct84);
          stmt.executeUpdate(addProduct85);
          stmt.executeUpdate(addProduct86);
          stmt.executeUpdate(addProduct87);
          stmt.executeUpdate(addProduct88);
          stmt.executeUpdate(addProduct89);
          stmt.executeUpdate(addProduct90);
          stmt.executeUpdate(addProduct91);
          stmt.executeUpdate(addProduct92);
          stmt.executeUpdate(addProduct93);
stmt.close();
con.close();
          catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
public static void addMembers(){
Connection con = getConnection();
String addMember1, addMember2, addMember3, addMember4, addMember5, addMember6, addMember7, addMember8, addMember9, addMember10;
addMember1 = "insert into Member values (1234, 'Ann', 'Smyth', 'Upper Killult, Falcarragh, Co. Donegal', '(074)-9135210', '(087)-2030172', #5/11/85#, #5/12/06#)";
addMember2 = "insert into Member values (2345, 'John', 'Murphy', 'Lower Killult, Falcarragh, Co. Donegal', '(074)-9135211', '(087)-2030173', #4/12/85#, #6/13/06#)";
addMember3 = "insert into Member values (1324, 'James', 'McFadden', 'Lower Ardsbeg, Gortahork, Co. Donegal', '(074)-9165314', '(087)-2030171', #4/11/85#, #6/14/06#)";
addMember4 = "insert into Member values (1235, 'Frankie', 'Ferry', 'Ardsmore, Gortahork, Co. Donegal', '(074)-9165325', '(087)-2031234', #6/13/60#, #6/15/06#)";
addMember5 = "insert into Member values (1236, 'Daniel', 'McKimm', 'Ballyness, Falcarragh, Co. Donegal', '(074)-9135212', '(087)-2030184', #5/14/73#, #6/16/06#)";
addMember6 = "insert into Member values (2346, 'Stephen', 'Doohan', 'Ballyness, Falcarragh, Co. Donegal', '(074)-9135213', '(087)-2030185', #6/13/85#, #5/13/06#)";
addMember7 = "insert into Member values (2347, 'James', 'Ferry', 'Meenlaragh, Gortahork, Co.Donegal', '(074)-9165360', '(087)-2031345', #9/12/85#, #5/14/06#)";
addMember8 = "insert into Member values (2348, 'Liam', 'Cannon', 'Derryconner, Gortahork, Co.Donegal', '(074)-9165324', '(087)-2031456', #4/11/86#, #5/15/06#)";
addMember9 = "insert into Member values (2401, 'Ciaran', 'Ferry', 'Brinalack, Gweedore, Co.Donegal', '(074)-9176425', '(087)-2030282', #9/12/85#, #5/16/06#)";
addMember10 = "insert into Member values (2402, 'Ciaran', 'McGee', 'Derrybeg, Gweedore, Co.Donegal', '(074)-9176536', '(087)-2030393', #9/14/85#, #5/18/06#)";
try {
stmt = con.createStatement();
stmt.executeUpdate(addMember1);
stmt.executeUpdate(addMember2);
stmt.executeUpdate(addMember3);
               stmt.executeUpdate(addMember4);
               stmt.executeUpdate(addMember5);
               stmt.executeUpdate(addMember6);
               stmt.executeUpdate(addMember7);
               stmt.executeUpdate(addMember8);
               stmt.executeUpdate(addMember9);
               stmt.executeUpdate(addMember10);
stmt.close();
con.close();
          catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
     public static void addRentals(){
Connection con = getConnection();
String addRental1, addRental2, addRental3, addRental4, addRental5, addRental6, addRental7, addRental8, addRental9, addRental10;
addRental1 = "insert into Rental values (110001, 'The Killers - Sams Town', 1234, 'Ann', 'Smyth', #9/01/06#, #9/10/06#, 'Yes', 2.00)";
addRental2 = "insert into Rental values (120001, 'Mission Impossible 3', 2345, 'John', 'Murphy', #9/02/06#, #9/09/06#, 'No', 0.00)";
addRental3 = "insert into Rental values (130001, 'Need for Special Carbon', 1324, 'James', 'McFadden', #9/03/06#, #9/12/06#, 'Yes', 2.00)";
addRental4 = "insert into Rental values (110002, 'Robbie Williams - Rudebox', 1235, 'Frankie', 'Ferry', #9/04/06#, #9/11/06#, 'No', 0.00)";
addRental5 = "insert into Rental values (120015, 'Prime', 1236, 'Daniel', 'McKimm', #9/05/06#, #9/14/06#, 'Yes', 2.00)";
addRental6 = "insert into Rental values (130015, 'FIFA 07', 2346, 'Stephen', 'Doohan', #9/06/06#, #9/13/06#, 'No', 0.00)";
addRental7 = "insert into Rental values (110009, 'Roxette - Roxette hits', 2347, 'James', 'Ferry', #9/07/06#, #9/16/06#, 'Yes', 2.00)";
addRental8 = "insert into Rental values (120003, 'The Break Up', 2348, 'Liam', 'Cannon', #9/08/06#, #9/15/06#, 'No', 0.00)";
addRental9 = "insert into Rental values (130027, 'Gears of War', 2401, 'Ciaran', 'Ferry', #9/09/06#, #9/18/06#, 'Yes', 2.00)";
addRental10 = "insert into Rental values (110021, 'Scooter - Mind the Gap', 2402, 'Ciaran', 'McGee', #9/10/06#, #9/17/06#, 'No', 0.00)";
try {
stmt = con.createStatement();
stmt.executeUpdate(addRental1);
stmt.executeUpdate(addRental2);
stmt.executeUpdate(addRental3);
               stmt.executeUpdate(addRental4);
               stmt.executeUpdate(addRental5);
               stmt.executeUpdate(addRental6);
               stmt.executeUpdate(addRental7);
               stmt.executeUpdate(addRental8);
               stmt.executeUpdate(addRental9);
               stmt.executeUpdate(addRental10);
stmt.close();
con.close();
          catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
public Demo(){
super("Demo Test Frame");
setSize(350, 200);
comboBox = new JComboBox();
comboBox.addItem("jdbc:odbc:VideoLibrary");
qtm = new QueryTableModel();
JTable table = new JTable(qtm);
JScrollPane scrollpane = new JScrollPane(table);
JPanel p1 = new JPanel();
p1.setLayout(new GridLayout(3, 2));
p1.add(comboBox);
p1.add(new JLabel("Enter your query: "));
p1.add(queryField = new JTextField());
p1.add(new JLabel("Click here to send: "));
JButton jb = new JButton("Search");
jb.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
qtm.setHostURL();
qtm.setQuery(queryField.getText().trim());
p1.add(jb);
getContentPane().add(p1, BorderLayout.NORTH);
getContentPane().add(scrollpane, BorderLayout.CENTER);
}//end class
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class LogOn extends JPanel{
     private static JTextField username=null;
     private static JPasswordField password=null;
     private static JButton button=null;
public LogOn(){
          setSize(260,160);
          username=new JTextField(15);
     password=new JPasswordField(15);
          //JPanel pane=new JPanel();
          JLabel usernameLabel=new JLabel("Username: ");
          JLabel passwordLabel=new JLabel("Password: ");
          /*pane.*/add(usernameLabel);
          /*pane.*/add(username);
          /*pane.*/add(passwordLabel);
          /*pane.*/add(password);
          //setContentPane(pane);
          show();
          button=new JButton("Ok");
          add(button);
     button.addActionListener(new ButtonListener());
          JFrame frame=new JFrame("Welcome to Home Entertainment");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     frame.getContentPane().add(new LogOn());
     frame.pack();
     frame.setVisible(true);
     private class ButtonListener implements ActionListener{
     public void actionPerformed(ActionEvent e){
          try{
                    new Demo();
               catch(Exception ex){}     
}

here's the code (again, but it doesn't look as ugly as it did earlier on).
i have three programs, only 2 of which can interact with each other. QueryTestTable.java is used with Demo.java to display data in a JTable. the third program is called LogOn.java. i want to use the LogOn.java (username and password for logging on to the system) program in order to be able to use the other 2 programs. i have to be able to use these programs next week. thank you very much.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.JOptionPane;
import java.sql.*;
public class Demo extends JFrame {
   static String url = "jdbc:odbc:VideoLibrary";
   static Statement stmt;
   static Connection con;
   //declare member variables here
   JTextField hostField;
   JTextField queryField;
   QueryTableModel qtm;
   JComboBox comboBox;
   public static void main(String args[]){
      //new LogOn();
      int choice=-1;
      do{
         choice=getChoice();
         if(choice!=0){
            getSelected(choice);
      }while(choice!=5);
      System.exit(0);
   public static int getChoice(){
      String choice;
      int ch;
      choice = JOptionPane.showInputDialog(null,"1. Maintain product      
      details\n"+"2. Maintain member details\n"+"3. Maintain rental 
      details\n"+"4. View product, member and rental details\n"+"5. Log 
      Off\n\n"+"Enter your choice");
      ch = Integer.parseInt(choice);
      return ch;
   public static void getSelected(int choice){
      if(choice==1){
         addProducts();
      if(choice==2){
         addMembers();
      if(choice==3){
         addRentals();
      if(choice==4){
         Demo test = new Demo();
         test.setVisible(true);
   public static Connection getConnection(){
      try {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      catch(java.lang.ClassNotFoundException e) {
         System.err.print("ClassNotFoundException: ");
         System.err.println(e.getMessage());
      try {
         con=DriverManager.getConnection(url,"","");
      catch(SQLException ex) {
         System.err.println("SQLException: " + ex.getMessage());
      return con;
   public static void addProducts(){
      Connection con = getConnection();
      String addProduct1, addProduct2;
      addProduct1 = "insert into Product values (110001, 'The Killers -  
      Sams Town', 5.00, 'G', 'CD', 2006)";
      addProduct2 = "insert into Product values (110002, 'Robbie
      Williams - Rudebox', 5.00, 'G', 'CD', 2006)";
      try {
         stmt = con.createStatement();
         stmt.executeUpdate(addProduct1);
         stmt.executeUpdate(addProduct2);
         stmt.close();
         con.close();
      catch(SQLException ex) {
         System.err.println("SQLException: " + ex.getMessage());
   public static void addMembers(){
      Connection con = getConnection();
      String addMember1, addMember2;
      addMember1 = "insert into Member values  
      (1234, 'Ann', 'Smyth', 'Upper Killult, Falcarragh, Co. Donegal', '(074)-
      9135210', '(087)-2030172', #5/11/85#, #5/12/06#)";
      addMember2 = "insert into Member values
      (2345, 'John', 'Murphy', 'Lower Killult, Falcarragh, Co.
      Donegal', '(074)-9135211', '(087)-2030173', #4/12/85#, #6/13/06#)";
      try {
         stmt = con.createStatement();
         stmt.executeUpdate(addMember1);
         stmt.executeUpdate(addMember2);
         stmt.close();
         con.close();
      catch(SQLException ex) {
         System.err.println("SQLException: " + ex.getMessage());
   public static void addRentals(){
      Connection con = getConnection();
      String addRental1, addRental2;
      addRental1 = "insert into Rental values (110001, 'The Killers - 
      Sams Town', 1234, 'Ann', 'Smyth', #9/01/06#, #9/10/06#, 'Yes', 2.00)";
      addRental2 = "insert into Rental values (120001, 'Mission
      Impossible 3', 2345, 'John', 'Murphy', #9/02/06#, #9/09/06#, 'No',
      0.00)";
      try {
         stmt = con.createStatement();
         stmt.executeUpdate(addRental1);
         stmt.executeUpdate(addRental2);
         stmt.close();
         con.close();
      catch(SQLException ex) {
         System.err.println("SQLException: " + ex.getMessage());
   public Demo(){
      super("Demo Test Frame");
      setSize(350, 200);
      comboBox = new JComboBox();
      comboBox.addItem("jdbc:odbc:VideoLibrary");
      qtm = new QueryTableModel();
      JTable table = new JTable(qtm);
      JScrollPane scrollpane = new JScrollPane(table);
      JPanel p1 = new JPanel();
      p1.setLayout(new GridLayout(3, 2));
      p1.add(comboBox);
      p1.add(new JLabel("Enter your query: "));
      p1.add(queryField = new JTextField());
      p1.add(new JLabel("Click here to send: "));
      JButton jb = new JButton("Search");
      jb.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                  qtm.setHostURL();
                  qtm.setQuery(queryField.getText().trim());
      p1.add(jb);
      getContentPane().add(p1, BorderLayout.NORTH);
      getContentPane().add(scrollpane, BorderLayout.CENTER);
}//end class
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class LogOn extends JPanel{
   private static JTextField username=null;
   private static JPasswordField password=null;
   private static JButton button=null;
   public LogOn(){
      setSize(260,160);
      username=new JTextField(15);
      password=new JPasswordField(15);
      //JPanel pane=new JPanel();
      JLabel usernameLabel=new JLabel("Username: ");
      JLabel passwordLabel=new JLabel("Password: ");
      /*pane.*/add(usernameLabel);
      /*pane.*/add(username);
      /*pane.*/add(passwordLabel);
      /*pane.*/add(password);
      //setContentPane(pane);
      show();
      button=new JButton("Ok");
      add(button);
      button.addActionListener(new ButtonListener());
      JFrame frame=new JFrame("Welcome to Home Entertainment");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.getContentPane().add(new LogOn());
      frame.pack();
      frame.setVisible(true);
   private class ButtonListener implements ActionListener{
      public void actionPerformed(ActionEvent e){
         try{
            new Demo();
         catch(Exception ex){}
import java.sql.*;
import java.io.*;
import java.util.Vector;
import javax.swing.*;
import javax.swing.table.*;
public class QueryTableModel extends AbstractTableModel{
   Vector cache; 
   int colCount;
   String[] headers;
   Connection db;
   Statement statement;
   String currentURL;
   public QueryTableModel(){
      cache=new Vector();
      try{
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      catch(Exception e){
         System.out.println("problem loading the driver ");
   public String getColumnName(int i){
      return headers;
public int getColumnCount(){
return colCount;
public int getRowCount(){
return cache.size();
public Object getValueAt(int row, int col){
return ((String[])cache.elementAt(row))[col];
public void setHostURL(){
String url = "jdbc:odbc:VideoLibrary";
closeDB();
try{
db=DriverManager.getConnection(url,"","");
statement=db.createStatement();
catch(Exception e){
System.out.println("Could not initialize the database.");
e.printStackTrace();
public void setQuery(String q){
cache=new Vector();
String s="select * from Product";
try{
ResultSet rs=statement.executeQuery(q);
ResultSetMetaData meta=rs.getMetaData();
colCount=meta.getColumnCount();
headers=new String[colCount];
for(int h=1;h<=colCount;h++){
headers[h-1]=meta.getColumnName(h);
while(rs.next()){
String[] record=new String[colCount];
for(int i=0;i<colCount;i++){
record[i]=rs.getString(i+1);
cache.addElement(record);
fireTableChanged(null);
catch(Exception e){
cache=new Vector();
e.printStackTrace();
public void initDB(String url){
try{
db=DriverManager.getConnection(url);
statement=db.createStatement();
catch(Exception e){
System.out.println("Could not initialize the database.");
e.printStackTrace();
public void closeDB(){
try{
if(statement!=null){
statement.close();
if(db!=null){
db.close();
catch(Exception e){
System.out.println("Could not close the current connection.");
e.printStackTrace();

Similar Messages

  • Embeding a SAP GUI based Report program into EP portal

    Hi experts,
                      I need a help, Is their any way to integrate a GUI based report program into EP portal. If yes can some one post how is it possible to acheive this functionality?.

    You may try the following options
    A. Transaction iView
        1.Make a transaction for the report program.
        2.Create an iView in Portal for transaction
    B. ITS service
         1.Make a transaction for the report program.
         2.Create an ITS service and pass the transaction name to the parameter ~TRANSACTION in the ITS service
         3.Create an iView in Portal for ITS service
    This way you will be able to call report program in Portal.

  • What are the IEDriver version requirements for using Microsoft Webdriver tool with a selenium based test tool?

    Hi,
    We are using IEDriver 2.44.0 with microsoft webdriver tool Windows7-KB2990999-x64.msu update with IE11.
    Using IMPLEMENTATION=VENDOR, we are not able to get this IEDriver version working with out selenium based test tool, with or without microsoft webdriver tool.
    I can see the driver IMPLEMENTATION set to VENDOR in the log, it also brings up the browser, but gets stuck there.Is this a known issue?ThanksTanvi

    Selenium is a third party software, so it is not supported in MSDN forum. It would be better consult to selenium's office website or forum. Some placa like here:
    http://www.seleniumhq.org/support/
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I used the compatibility button with IE and our company program. I can't get the company program to work using Firefox. How do I make compatiable?

    With IE and my company program access, I used the compatibility button so it would work. I can't find a solution with Firefox to utilize my company program. I tried Shift Control R and Shift reload. But to no avail. I really need to use my company program to access account info and I am not wanting to resort back to using IE as my internet browser. Please help.

    As you have discovered, Firefox does not have a feature similar to IE's compatibility mode where non-standards-compliant pages designed for older versions of IE can run in newer versions of IE.
    The solution really depends on what is wrong with those pages. Does your IT support Firefox and/or are they willing to make fixes?
    Note that you can use different browsers for different sites. If you need IE for internal sites, that doesn't mean you can't use Firefox for your regular browsing. You wouldn't be the only person in this thread doing that. ;-)

  • Can I use Windows based DW cs4 files on a Mac with an Apple based DW program?

    Have been using DW cs4 with Windows Vista.  Buying a Mac soon and am wondering if I can use those files on a Mac with an Apple version on DW?.  Thank you

    I would just save a copy of the local site folder and the .ste on a thumb drive and copy them over to the new machine.
    You don't have to export it directly onto the thumb/flash drive or anything. Actually, you don't "need" the .ste at all.
    The only reason to make the .ste file is to transfer over your site-specific settings (like FTP credentials) without having to re-type/re-select everything, it doesn't copy any actual site files over.
    Once the site files are copied over, you can just go to Site > New to set up the new site. Rather than going to a new blank folder, you would set the Local Root Directory to the newly copied site folder.

  • Using Automator to open a program with a delay after a programmed restart

    Hi to all! With my old PowerPc I used to start unattended sessions of my Newsreader (Unison) overnight simply putting Unison in my Login elements window, and programming a restart at a fixed hour. Unfortunately, with my very fast new iMac this doesn't work: Unison opens too fast after the programmed restart, before a network connection has been established, and Unison is unable to see the NewsServer online when it starts (error "nodelist not found", typical of a not yet established Internet connection). Note that I downgrade to Unison 1.8.x to do this, as the Unison 2.x program cannot be closed with a session running to resume it after start: it simply defaults to "Pause transfers" after quitting, and need a clic on "Resume" after reopening.
    Obviously, what I need is to introduce a "wait (say) 2 minutes before the opening of Unison", or anything that can check the Internet connection before Unison starts. May anyone instruct me to do this with Automator and/or AppleScript?
    In fact, I tried to generate a workflow in Automator, with a Pause after the start of the process, then the instruction to open Unison. I put the saved workflow in my Login elements, but it didn't work on my iMac 27, i7Core, Snow Leopard installed. I added an "execute workflow" at beginning of the process, but the Pause command gives always an error and the process stops before Unison' opening.
    Any suggestion or help in writing an Automator or AppleScript workflow/script to be put among the startup items?
    Thanks a lot!

    I am trying to use Automator to restart an application. I figured how to quit the application, however when I relaunch it, it asks for password permission... how can I use automator to enter the password? or is there a way to launch the software with password in a script?

  • Java.rmi.ConnectException using webstart Swing client with WL 8.1 SP2 in a

    Hi all,
    I'm receiving the following exception when invoking a remote method on
    a cached remote stub. This only happens if there are at least two
    nodes running in a cluster. It happens more often the more nodes are
    running.
    It seems that the exception occurs if for a call to a remote method a
    cached stub is used, and if that call is referred to a different node
    in the cluster by the load balancer than the one that the stub
    originally came from. But I'm not completely sure about that...
    Client side config:
    Webstart
    JDK 1.4.2_05
    weblogic.jar (we're experiencing other problems already discussed in
    this group when using wlclient.jar)
    Server side config:
    Weblogic 8.1 SP2
    cluster on Sun Solaris machines (two nodes, one manager)
    Here is the exception stacktrace:
    java.rmi.ConnectException: Could not establish a connection with
    2198062098923170717S:shebea219:[7001,7001,-1,-1,7001,-1,-1,0,0]:SHEBEA219,SHEBEA334:DaGama:DaGamaNode1,
    java.security.AccessControlException: access denied
    (java.net.SocketPermission shebea219 resolve)
    at weblogic.rjvm.RJVMImpl.getOutputStream(RJVMImpl.java:316)
    at weblogic.rjvm.RJVMImpl.getRequestStream(RJVMImpl.java:488)
    at weblogic.rjvm.RJVMImpl.getOutboundRequest(RJVMImpl.java:584)
    at
    weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:91)
    at
    weblogic.rmi.internal.activation.ActivatableRemoteRef.invoke(ActivatableRemoteRef.java:69)
    at
    de.conet.dagama.interesengine.nativesession.SBNativeSession_8da95c_EOImpl_812_WLStub.isConnected(Unknown
    Source)
    at
    de.conet.dagama.agent.flight.nativ.FlightNativeListener.doExitNativeSession(FlightNativeListener.java:244)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at
    de.objektpark.framework.command.CommandInvoker.invoke(CommandInvoker.java:132)
    at
    de.objektpark.framework.command.CommandProcessor.doService(CommandProcessor.java:169)
    at
    de.objektpark.framework.command.CommandProcessor.service(CommandProcessor.java:131)
    at
    de.objektpark.framework.command.CommandProcessor.execute(CommandProcessor.java:71)
    at
    de.conet.webactiv.swing.command.GUICommandProcessor.execute(GUICommandProcessor.java:87)
    at
    de.conet.webactiv.swing.controller.GUICommandController.execute(GUICommandController.java:98)
    at
    de.conet.webactiv.swing.controller.GUICommandController.execute(GUICommandController.java:124)
    at
    de.conet.dagama.agent.flight.nativ.FlightFreeNativeView.this_windowClosing(FlightFreeNativeView.java:84)
    at
    de.conet.dagama.agent.flight.nativ.FlightFreeNativeView$1.windowClosing(FlightFreeNativeView.java:73)
    at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
    at java.awt.Window.processWindowEvent(Unknown Source)
    at javax.swing.JFrame.processWindowEvent(Unknown Source)
    at java.awt.Window.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    Has anyone ever come across the same problem and possibly found a
    solution?
    Any help would be greatly appreciated.
    Thanks in advance
    Rolf

    Hi all,
    I'm receiving the following exception when invoking a remote method on
    a cached remote stub. This only happens if there are at least two
    nodes running in a cluster. It happens more often the more nodes are
    running.
    It seems that the exception occurs if for a call to a remote method a
    cached stub is used, and if that call is referred to a different node
    in the cluster by the load balancer than the one that the stub
    originally came from. But I'm not completely sure about that...
    Client side config:
    Webstart
    JDK 1.4.2_05
    weblogic.jar (we're experiencing other problems already discussed in
    this group when using wlclient.jar)
    Server side config:
    Weblogic 8.1 SP2
    cluster on Sun Solaris machines (two nodes, one manager)
    Here is the exception stacktrace:
    java.rmi.ConnectException: Could not establish a connection with
    2198062098923170717S:shebea219:[7001,7001,-1,-1,7001,-1,-1,0,0]:SHEBEA219,SHEBEA334:DaGama:DaGamaNode1,
    java.security.AccessControlException: access denied
    (java.net.SocketPermission shebea219 resolve)
    at weblogic.rjvm.RJVMImpl.getOutputStream(RJVMImpl.java:316)
    at weblogic.rjvm.RJVMImpl.getRequestStream(RJVMImpl.java:488)
    at weblogic.rjvm.RJVMImpl.getOutboundRequest(RJVMImpl.java:584)
    at
    weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:91)
    at
    weblogic.rmi.internal.activation.ActivatableRemoteRef.invoke(ActivatableRemoteRef.java:69)
    at
    de.conet.dagama.interesengine.nativesession.SBNativeSession_8da95c_EOImpl_812_WLStub.isConnected(Unknown
    Source)
    at
    de.conet.dagama.agent.flight.nativ.FlightNativeListener.doExitNativeSession(FlightNativeListener.java:244)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at
    de.objektpark.framework.command.CommandInvoker.invoke(CommandInvoker.java:132)
    at
    de.objektpark.framework.command.CommandProcessor.doService(CommandProcessor.java:169)
    at
    de.objektpark.framework.command.CommandProcessor.service(CommandProcessor.java:131)
    at
    de.objektpark.framework.command.CommandProcessor.execute(CommandProcessor.java:71)
    at
    de.conet.webactiv.swing.command.GUICommandProcessor.execute(GUICommandProcessor.java:87)
    at
    de.conet.webactiv.swing.controller.GUICommandController.execute(GUICommandController.java:98)
    at
    de.conet.webactiv.swing.controller.GUICommandController.execute(GUICommandController.java:124)
    at
    de.conet.dagama.agent.flight.nativ.FlightFreeNativeView.this_windowClosing(FlightFreeNativeView.java:84)
    at
    de.conet.dagama.agent.flight.nativ.FlightFreeNativeView$1.windowClosing(FlightFreeNativeView.java:73)
    at java.awt.AWTEventMulticaster.windowClosing(Unknown Source)
    at java.awt.Window.processWindowEvent(Unknown Source)
    at javax.swing.JFrame.processWindowEvent(Unknown Source)
    at java.awt.Window.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    Has anyone ever come across the same problem and possibly found a
    solution?
    Any help would be greatly appreciated.
    Thanks in advance
    Rolf

  • I need a web based JDBC program

    Hello,
    I'm a web designer \web programmer. My experience has been with PHP and Mysql. But my Java skills are not that good since I�m new to it.
    I need to write a database program in Java and my database will be oracle.
    Basically this program is used for a restaurant where customers will be able to order online and the restaurant will see the order instantly (like Instant message) and process the order so when customer comes to pick it up, it will be ready.
    I just need help with this project like readings or sample if any of you are informed of. I prefer a sample database like it.
    I appreciate it.

    You start with the tutorial...
    http://java.sun.com/products/jdbc/learning.html
    Presumably you have already done one or more tutorials on swing, etc. If not then you should start there rather than on the jdbc tutorials.

  • How to connect with oracle8/8i in jdbc program

    Dear Pal
    I am getting problem in connecting Oracle8/8i database , I am registering driver using
    String dsnName = "jdbc:oracle:thin:@<Server>:<Port>:<DSN-Name>";
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    but it is giving error(name oracle.jdbc.driver.OracleDriver not declared as type) during compilation .
    Please help ...
    divyanand

    Never tried the oracle drivers, but the usual way to load a jdbc driver is:
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    catch(ClassNotFoundException cnfe) {
    System.out.println(cnfe.getMessage());
    And then you get a Connection object using:
    try {
    Connection con = DriverManager.getConnection(dnsName);
    catch(SQLException sqle) {
    System.out.println(sqle.getMessage());
    }

  • Can I use Swing controls with Forms 9i?

    Is there a way to use Java Swing controls with Forms 9i via a PJC or something? If so, is there a white paper on it? Thanks.

    Yes you can. There is a quick start about PJC here:
    http://otn-stage.us.oracle.com/products/forms/htdocs/upgrade/pjc/content.html
    And there is also a paper about Forms in the Java World that you should read.
    http://otn.oracle.com/products/forms/pdf/forms_in_java_world.pdf
    You might want to have a look at the Oracle9i Forms Demos for some code samples as well.

  • GUI based multiplayer game

    Can i use JAVA FX for creating simple GUI based multiplayer card game?

    Narayan wrote: But you need some server script/programming like Servlet,PHP.You may use Servlet or PHP like Narayan stated before, but i would recomend JAVA RMI for the "Client to Server" or "Client to Client" - communication. The Advantage of using RMI in Javafx is you don´t need anny extra or external 3rd party lib. RMI is core Java.
    If you need a Sample just google around there a plenty of tutorials. and they are all written in pure java.

  • How to program with different device by NI-VISA?

    Dear NIer:
    firstly I will list my enviroment.
    SW:Labwindows/cvi 5.5/VISA/MAX.
    HW:HP pc/pci-gpib/GPIB-VXI/DD42916.
    QUESTION:
    1 MAX always think GPIB-VXI/C and DD42916 as a GPIB device.Why don't they think these devices listed above as a VXI device?
    2 Since MAX think DDC42916 as a GPIB device, and DDC42916 supports word serial communication, How can I program with this message-based device by NI-VISA?
    I searched for appropriate function in NI-VISA ref manual,but I failed.VXI WSPRotocal COMMand is not suitable here evidently.
    3 Then how can I program the other device like register-based device and memory-based device under this circumstance?
    4 if slot0 controller changed from GPIB/VXI to 1394/VXI
    ,then how to program?

    east-
    I see this question was answered (and then discussed again in depth) in the VISA forum. I'm posting these links in case anyone looks here for an answer.
    -Scot

  • Call report selection screen in module pool program with tab strip control

    Hi,
    Could anyone explain in detail to call report selection screen in module pool program with tab strip control.
    Thanks
    Mano

    Hi,
    Refer std program:
    demo_sel_screen_in_tabstrip.
    demo_sel_screen_with_tabstrip.
    Call your program with SUBMIT stmt form module program.
    Reward points if this Helps.
    Manish

  • Our software vendor tells to use FF 3.5.1. because of some printer issues with their web based program. How safe is it to work with FF 3.5.1 in 2012?

    Our software vendor tells to use FF 3.5.1. because of some printer issues with their web based program. How safe is it to work with FF 3.5.1 in 2012?

    Thanks for the reply. I'll have a look at your solution.

  • Using Mac email program with Web-based email

    I'm wondering if there is a way to use the Mac email program with Web-based email (like Gmail, etc).
    If this is possible then how can I set up my system.
    Thanks much.

    Yes you can use gmail using Mail software.
    Following is prosidure:
    1)-Login to ur gmail A/s
    - Go to settings click Forward POP Settings the click Enable POP and click Save.
    2) open mail-POP settings
    -Type your Email address, Password,
    Incoming server:pop.gmail.com
    SMTP server: smtp.gmail.com
    Type and give the Bolded server in specified path
    and follow the instruction.

Maybe you are looking for

  • Suppress the Default File Types dialogue, Office 2013 C2R

    Hi. We are doing a rather large Office 365 Proplus deployment using click-to-run via SCCM. We have the relevant group policys configured for the most part but we can't figure out how to get rid of the Default File Types dialogue box that pops up duri

  • Error importing *.SCA file into NWDS:  Import (into source SC) not possible

    All, When attempting to import an SCA into a new project in NWDS, an "Import (into source SC) not possible: SCA doesn't contain DC sources" occurs.  Any assistance to fix this issue appreciated. Thanks, Lee

  • Inserting images into a PDF

    I would like the end user to able to upload there logo into a designated area in the PDF. Short version... User clicks on button in the PDF and a dialog box appears so the user can choose thier logo. It appear in the designated area. Is this possible

  • Database link from 10g database to 8i

    Is it possible to create a database link from 10g(10.1.0) to talk to a 8i(8.1.7) database? I'm using a database link between a 9i database to 8i database, and would like to upgrade the 9i database to 10g. I created a link in 10g and kept getting the

  • Can not close a website that popped up

    This site popped up and now I can not close it. http://visitorssurveygroup.com/g/winner/prize_ns_p.php