gpt4 book ai didi

java - 如何使用Get方法从海量中提取值(value)?

转载 作者:行者123 更新时间:2023-12-01 19:40:10 25 4
gpt4 key购买 nike

我有这个代码

public void insertStart_auto_load_test_step_info(int countUsers ) throws SQLException{      
String insert_auto_load_test_user_info = "insert into auto_load_test_step_info(id_user_info,start_time,step_id) values(" + getIdValue1()+ getCrokStarTime() + "2";
PreparedStatement pstmt = this.con.prepareStatement(insert_auto_load_test_user_info, Statement.RETURN_GENERATED_KEYS);
pstmt.executeUpdate();

还有这个类

public class Info {
private int crok = 0;
private int testId = 0;
private int testCaseId = 1;
private long starTime;
private long crokStarTime;
private long crokFinishTime;
int [] idValue1 = new int[100];
int [] idValue2 = new int[100];
int id_case_info = 0;


public int[] getIdValue2() {
return idValue2;
}
public void setIdValue2(int idValue2, int i) {
this.idValue2[i] = idValue2;
}
public int getId_case_info() {
return id_case_info;
}
public void setId_case_info(int id_case_info) {
this.id_case_info = id_case_info;
}
public int[] getIdValue1() {
return idValue1;
}
public void setIdValue1(int idValue1, int i) {
this.idValue1[i] = idValue1;
}

我需要从此方法 getIdValue1() 添加到我的插入值,我该怎么做?我想,一定有某种索引,但我不知道如何使用它。

最佳答案

根据 setIdValue2() 方法对其进行建模。

// You should check, somewhere, that i is a valid index of idValue2
public int getIdValue2(int i) {
return idValue2[i];
}

现在,您可以调用您的方法:int temp = getIdValue2(0);//获取第一个索引处的项目

关于java - 如何使用Get方法从海量中提取值(value)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59179935/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com