MAJIRANI I NEED YOU ADVISE HERE//nmejaribu stack overflow sisaidiki
why is this stuff not adding items kwa database[ATTACH=full]51892[/ATTACH]
MAJIRANI I NEED YOU ADVISE HERE//nmejaribu stack overflow sisaidiki
why is this stuff not adding items kwa database[ATTACH=full]51892[/ATTACH]
check your query by running it directly on the database…its either wrong or you have some unneeded white space somewhere
hii ni IDE gani?
post the query we take a look
netbeans
ume weka connector ya java na Mysql?
eeeh from login part nikiweka uname+pass manualy kwa database table inawork fiti sana but now creating a new user fro the GUI infail kuadd///
after some random advises from @The.Black.Templar nmekwama hapa>>>>>keep in mind me ni fresher kwa hii maneno[ATTACH=full]51918[/ATTACH]
String sql=“insert into login(user,password,lname,fname) values(‘?’,‘?’,‘?’,‘?’)”;
try{
pst=conn.prepareStatement(sql);
pst.setString(0, u.getText());
pst.setString(1, p.getText());
pst.setString(2, l.getText());
pst.setString(3, f.getText());
pst.executeQuery();
JOptionPane.showMessageDialog(rootPane, “SAVED SUCCESSFULLY”);
}catch(Exception e){
JOptionPane.showMessageDialog(rootPane, e);
}
i dont think the sql paramaters are being mapped properly
try the following
String sql=“insert into login(user,password,lname,fname) values(@user_name,@user_pwd,@last_name,@first_name)”;
/* then initialize your command as below(change to correct CommandObject)*/
using (Command command = new Command(sql, connection))
{
command.Parameters.Add(“@user_name”).Value = u.getText();
command.Parameters.Add(“@user_pwd”).Value = p.getText();
command.Parameters.Add(“@last_name”).Value = l.getText();
command.Parameters.Add(“@first_name”).Value = f.getText();
command.ExecuteNonQuery();
}
or the following
string sql = string.Format(“insert into login(user,password,lname,fname) values(‘{0}’,‘{1}’,‘{2}’,‘{3}’);”,u.getText(),p.getText(),l.getText(),f.getText());
Command command = new Command(sql, connection));
command.ExecuteNonQuery
Apana tambua JAVA.Real Birrioneas like @rollout use ASSEMBLER only and notepad
Yenyewe hii yote ni kizungu mkuti kwangu
chambua hio kwanza
push ecx
lea ecx, [esp] + 8 ; TOS before entering this function
sub ecx, eax ; New TOS
and ecx, (16 - 1) ; Distance from 16 bit align (align down)
add eax, ecx ; Increase allocation size
sbb ecx, ecx ; ecx = 0xFFFFFFFF if size wrapped around
or eax, ecx ; cap allocation size on wraparound
pop ecx ; Restore ecx
jmp _chkstk
Very simple. Badilisha hiyo [FONT=Courier New]pst.executeQuery();[/FONT] ikuwe [FONT=Courier New]pst.executeUpdate();[/FONT]
man pia hio bro[ATTACH=full]51949[/ATTACH]
Check yo
It seems you are calling an index outside the array
How have you initialized the array? If possible post here the snippet for how you fetch elements from it
also insert break points into your code…they help in pin pointing out where the issue is
THANKS FINALLY MR @kukufry AND ALL WHO ASSISTED ME INBOSK>>>>>FINALLY YANI THE SINGLE QUOTES NDIO SHIDA
String sql = “insert into login (user,password,lname,fname) values U[/U]”; THIS WAS WHERE THE ERROR WAS////@kukufry PITIA HAPO S.J UPEWE BJ ZA 200 NA MARAYA AINBOSK TILL NO. YA PUSSY NILIPE NA MPESA:D:D:D:D HAZANDE