更新查询成功执行,但数据未在Java中更新

时间:2018-09-03 07:54:39

标签: java mysql model-view-controller

我的代码正常工作,但是数据库中的数据未更新。我正在使用MySQL数据库,请在附件中找到我的代码。如果有其他需要,请帮助我。 enter image description here 情况5:

Scanner sc1 = new Scanner(System.in);
System.out.println("Enter roll no You Want to update");
int rollno = sc1.nextInt();
System.out.println("Enter Student update Name: ");
String name = sc1.next();
System.out.println("Enter Student update Address: ");
String address = sc1.next();
updateStudent(name,rollno,address);

break;

enter image description here

1 个答案:

答案 0 :(得分:2)

您在准备好的语句中的索引有问题。

rollno必须是索引3

public async Task<SetParams> GetParams(CreateRequest request)
        {
            var user = await _userRepository.GetUserByLogin(request.Login);  
            var client = await _clientRepository.GetClientByCode( request.ClientCode);

            // many other getters here 

            return new SetParams
            {
                IdUser = user.IdUser,
                ClientName = client.Name,
                // and so forth...
            };
        }
相关问题