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

سؤال في Jdbc

بدأه لؤلؤه مضيئه في 16 يناير 2009 · 1 رد · 589 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكــم ورحمـة الله وبركاتــه

عندي مشكله في برنامجي وهويعرض صور متحركه لمجموعة كلمات تم ادخالها من المستخدم فيقوم البرنامج بالبحث عن الكلمات في قاعدة البيانات واذا وجدها عرض صورها المتحركه واذا لم يجدها يطبع حروفها والمشكله هي كيف اني اجعل بين كل عرض واخر وقت حتى لا تعرض كلهم في وقت واحد ويوجدد ايضا 2 error

ارجو المساعده عاجلا

String text;
	 String [] text1,text2;
		System.out.println("plz enter your statement");
 Scanner input=new Scanner(System.in);
 text=input.nextLine();

	text1=text.split(" ");

int  w=text1.length;

 try{


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


	Connection c = DriverManager.getConnection("jdbc:odbc:oracle", "system", "123456");
	   Statement s = c.createStatement();
	for(int n=0;n<w;++n)
	{
	   ResultSet results = s.executeQuery(
  "select path from word where name==text1[n]; ");

	String location =results.getString();
	ImageIcon icon = new ImageIcon(location);
JLabel lPhoto = new JLabel(icon);
setLayout(new GridLayout(1, 1));
add(lPhoto);
	if(location==null)//if the word is not found in database


	{

		//String t= text1.getText();
		 int j=text1[n].length();   
String result="";
			int i =0;
			for(i=0;  i<j;i++)
			{
			   result += text1[n].substring(i,i+1)+" \n ";


			}
			jLabel2.setText(result);}}

 }
	catch( Exception a ) {
  }
#2
اقتباس
ResultSet results = s.executeQuery(

"select path from word where name==text1[n]; ");

String location =results.getString();

لن يعمل هذا الكود

الرجاء مراجعة كود ارجاع قيم من قاعدة البيانات

استخدمي البحث للوصول لما تريدي

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