wafa khan

Ranch Hand
+ Follow
since Apr 29, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by wafa khan

Normaly .. means i use it to get connexion to database that i select in combobox in the jframe


10 years ago
i have this code in actionperformed of button

and in begining of jframa i declared this


then in other classe i use the variable db normaly
but it gives me nothing
How can i use the items in comobobox in another classes java
10 years ago
Hello
i have a jframe when i have a jcombobox contains databases and i click on button
so i want pass or use this jcombobox in another classe java
because i want to some queries in this class so i need connection to database and database is the item selected from the jcombobox
i do like this
in jframe in begining i write this code :

and in Actionlistener of button i do this:


then in the other classe i do that

But they tell me that any database founded means the variable that i pass from jframe to class java dosen't work
what can i do
help me please
thank you

10 years ago
ah okey i understand now
10 years ago
the filechooser dosen't opened ..
10 years ago
when we click on jbutton the window that contains all of files show so i must choice there an file but it's not opened
10 years ago
Hi
I have code java swing to open a file that i choose when the window of filechooser opened
this is the code but when the window opened and i choice some file it not opened and it gives me any error

Thank you for help
10 years ago
YES it works tha line contains 20 dosent inserted SO it's write why the query dosent work
de you mean i write the query of sql in the code java in code of statement?


And this Error about the query
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','','','172.16.2.159 '
FROM dual
WHERE NOT EXISTS (SELECT VLAN FROM tout WHERE' at line 2

this an line in my tables sql but i don't know what they say that
I have test the first query in SQL and it works but in code NO

this is the query :

And this is the code test in SQL

i try with many queries but any result

and i don't know that MERGE

this is code with preparedstatement



ANd this ERROR:
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
Hi thank you for replayin but i don't understand what you mean
i change code at this query but they give me this error:

java.sql.SQLException: Column count doesn't match value count at row 1

And this is the code:


I execute program many times so every time the same data will be inserted i have repetition for that i want use Insert where not exists

Hi all of you
I have code to insert into table sql so it works but when i execute many times it will be inserted the same data then i have repetition
So i want do an query for Insert into table where not exists
i use it in many queries it works but here i have the insert from arraylist<>
i work with java

this is the code :






VLAN= it's the first column in table but not primary key
and table has 5 columns
VLAN,desc,jr,vrf,address
Thank you for help