الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

أود المساعدة منكم ارجوكم...

مغلق
بدأه Dhia19 في 12 أغسطس 2005 · 1 رد · 437 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Hi all I will be very thankful if anyone helping me in my lab project, because I am getting my Java course in this summer, the lab is I want to insert some names and phones in DB Access, and the numbers should be Auto, so I the help that I get up to this point and I couldn't finish it and it due on 13-Aug night. In addition I am using JBuilder and I put the name of the "odbc" is "PhoneBook" and the name for the Access file is PhoneBook and it has a password which is lab4 so can any one help me; The program is below:

import java.sql.*;

import java.io.*;

public class PhoneBook {

private static Connection con;

private static int ID;

private static String FName = "";

private static String LName = "";

private static String Phone = "";

public static void main ( String[] args){

try{ Class.forName ( "sun.jdbc.odbc.JdbcOdbcDriver" );

con = DriverManager.getConnection ( "jdbc:odbc:PhoneBook","admin", "lab4" );

}

catch ( Exception e ){System.out.println(e);}

/* Command Line Arguments:

i -f fname -l lname -p phone (insert new record)

r -f fname -l lname (rerieve phone given fname & lname)

r -f fname (retrieve phone given fname only)

r -l lname (retrieve phone given lname only)

d ID (delete record whose primary key is ID)

a (show all records and all attributes)

*/

for (int i = 1;i < args.length;i++)

{

if (args.compareTo("-f") == 0)

{

FName = args[i+1];

i = i + 1;

}

else if (args.compareTo("-l") == 0)

{

LName = args[i+1];

i = i + 1;

}

else if (args.compareTo("-p") == 0)

{

Phone = args[i+1];

i = i + 1;

}

}

switch(args[0].charAt(0))

{

case 'i':

System.out.println("Insert Op");

insert();

break;

case 'r':

System.out.println("Retrieve Op");

System.out.println("Phone number(s): " + getPhone());

break;

case 'd':

System.out.println("Delete Op");

ID = Integer.parseInt(args[1]);

delete();

break;

case 'a':

System.out.println("Show All");

showAll();

break;

}

}

public static void insert()

{

}

public static String getPhone()

{

String phone = "";

return phone;

}

public static void delete()

{

}

public static void showAll()

{

}

}

#2

للاسف الموضوع مخالف و سوف اضطر الى اغلاقه و يرجى مراجعة قواعد الطرح قبل المشاركة

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why

هذا الموضوع مغلق.

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…