Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public synchronized boolean create_auction(CreateAuctionObject obj) throws RemoteException
- {
- String sql_request = "INSERT INTO AUCTION(auctionid,onwner,code,title,description,max_amount,data) VALUES (auction_seq.nextval,?,?,?,?,?,?)";
- String seq = "auction_seq.nextval";
- //String data = "to_date('" +obj.getDeadline()+ "', 'yyyy/mm/dd hh24:mm')";
- // Get user auctions
- PreparedStatement prepStat;
- try
- {
- prepStat = conn.prepareStatement(sql_request);
- //Create Auction
- prepStat.setInt(1, obj.getOwnerId());
- prepStat.setInt(2, obj.getCode());
- prepStat.setString(3, obj.getTitle());
- prepStat.setString(4, obj.getDescription());
- prepStat.setInt(5,obj.getAmount());
- prepStat.setString(6, obj.getDeadline());
- prepStat.executeUpdate();
- update_database();
- update_user_data(obj.getOwnerId());
- System.out.println("Created Auction");
- }catch(SQLException se)
- {
- System.out.println("CREATING AUCTION SQL: " + se.getMessage());
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement