第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

這一直提示這個錯誤,感覺我語句沒寫錯啊。。。。求指導(dǎo)

insert into zoey_goddess(user_name,sex,age,birthday,email,mobile,create_user,create_date,update_user,update_date,isdel)values(?,?,?,?,?,?,?,current_date(),?,current_date(),?)


Exception in thread "main" java.sql.SQLException: ORA-00917: ????


at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)

at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:744)

at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:215)

at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:965)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)

at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3338)

at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3444)

at com.zoey.dao.GoddessDao.addGoddess(GoddessDao.java:59)

at com.zoey.action.GoddessAction.add(GoddessAction.java:11)

at com.zoey.test.TestAction.main(TestAction.java:73)

以上是報錯信息,下面是代碼

package com.zoey.test;


import java.util.Date;

import java.util.List;

import java.util.Scanner;


import com.zoey.action.GoddessAction;

import com.zoey.model.Goddess;



public class TestAction {

public void customerDest(){

System.out.println("歡迎來到客服中心,我們提供如下服務(wù)");

System.out.println("服務(wù)編號:"+"服務(wù)名稱");

System.out.println("1:查詢 ;2:增加;3:刪除;4:修改");

System.out.println("請選擇服務(wù)編號:");

Scanner console=new Scanner(System.in);

int input=console.nextInt();

if(input==1){

}

}


public static void main(String[] args) throws Exception {


GoddessAction action=new GoddessAction();

/*

Goddess g=new Goddess();

g.setUser_name("joey");

g.setSex(0);

g.setAge(25);

g.setBirthday(new Date());

g.setEmail("joey@163.com");

g.setMobile("15688888888");

g.setIsdel(1);

action.add(g);

*/

System.out.println("歡迎來到客服中心,我們提供如下服務(wù)");

System.out.println("1:查詢 ;2:增加;3:刪除;4:修改");

System.out.println("請選擇服務(wù)編號:");

Scanner console=new Scanner(System.in);

int input=console.nextInt();

if(input==1){

List<Goddess> result=action.query();

for (int i = 0; i < result.size(); i++) {

System.out.println(result.get(i).getId()+

":"+result.get(i).getUser_name());

}

}else if(input==2){

Goddess g=new Goddess();

System.out.println("請輸入要添加的女神姓名:");

String name=console.next();

System.out.println("請輸入要添加的女神的年齡:");

int age=console.nextInt();

System.out.println("請輸入要添加的女神的郵箱:");

String email=console.next();

System.out.println("請輸入要添加的女神的手機號:");

String telno=console.next();

g.setUser_name(name);

g.setSex(0);

g.setAge(age);

g.setBirthday(new Date());

g.setEmail(email);

g.setMobile(telno);

g.setCreate_user("sys");

g.setUpdate_user("sys");

g.setIsdel(1);

action.add(g);

}else{

System.out.println("222");

}


}


}



-----------------------------------------------------------

package com.zoey.dao;


import java.sql.Connection;

import java.sql.Date;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import java.util.ArrayList;

import java.util.List;


import com.zoey.db.DBUtil;

import com.zoey.model.Goddess;


public class GoddessDao {


public List<Goddess> query() throws Exception{

List<Goddess> result=new ArrayList<Goddess>();

Connection conn=DBUtil.getConnection();

StringBuilder sb=new StringBuilder();

sb.append("select id,user_name,age from zoey_goddess ?");

PreparedStatement ptmt=conn.prepareStatement(sb.toString());

ResultSet rs=ptmt.executeQuery();

Goddess g=null;

while(rs.next()){

g=new Goddess();

g.setId(rs.getInt("id"));

g.setUser_name(rs.getString("user_name"));

g.setAge(rs.getInt("age"));

result.add(g);

}

return result;

}


public void addGoddess(Goddess g) throws Exception{

Connection conn=DBUtil.getConnection();

String sql="" +

"insert into zoey_goddess"+

"(user_name,sex,age,birthday,email,mobile,"+

"create_user,create_date,update_user,update_date,isdel)"+

"values(" +

"?,?,?,?,?,?,?,current_date(),?,current_date(),?)";

PreparedStatement ptmt=conn.prepareStatement(sql);

System.out.println(sql);

ptmt.setString(1, g.getUser_name());

ptmt.setInt(2, g.getSex());

ptmt.setInt(3, g.getAge());

ptmt.setDate(4, new Date(g.getBirthday().getTime()));

ptmt.setString(5, g.getEmail());

ptmt.setString(6, g.getMobile());

ptmt.setString(7, g.getCreate_user());

ptmt.setString(8, g.getUpdate_user());

ptmt.setInt(9, g.getIsdel());

ptmt.execute();

}

}

----------------------------------------------------------------------

package com.zoey.action;


import java.util.List;


import com.zoey.dao.GoddessDao;

import com.zoey.model.Goddess;


public class GoddessAction {

public void add(Goddess goddess) throws Exception{

GoddessDao dao=new GoddessDao();

dao.addGoddess(goddess);

}

public List<Goddess> ?query() throws Exception{

GoddessDao dao=new GoddessDao();

return dao.query();

}

}


正在回答

1 回答

"create_user,create_date,update_user,update_date,isdel)"+

"values(" +

"?,?,?,?,?,?,?,current_date(),?,current_date(),?)";

這一句current_date()出現(xiàn)了兩次,導(dǎo)致建表語句出錯。數(shù)據(jù)庫表中字段命不能一樣。

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

曇花一現(xiàn)2

.............
2016-10-31 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

這一直提示這個錯誤,感覺我語句沒寫錯啊。。。。求指導(dǎo)

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號