1 package org.apache.ojb.broker.platforms; 2 3 17 18 import java.sql.CallableStatement ; 19 import java.sql.Connection ; 20 import java.sql.Types ; 21 import java.sql.SQLException ; 22 23 29 public class PlatformMsSQLServerImpl extends PlatformDefaultImpl 30 { 31 36 public byte getJoinSyntaxType() 37 { 38 return SQL92_NOPAREN_JOIN_SYNTAX; 39 } 40 41 public CallableStatement prepareNextValProcedureStatement(Connection con, String procedureName, 42 String sequenceName) throws PlatformException 43 { 44 try 45 { 46 String sp = "{?= call " + procedureName + " (?)}"; 47 CallableStatement cs = con.prepareCall(sp); 48 cs.registerOutParameter(1, Types.INTEGER); 49 cs.setString(2, sequenceName); 50 return cs; 51 } 52 catch (SQLException e) 53 { 54 throw new PlatformException(e); 55 } 56 } 57 58 public String getLastInsertIdentityQuery(String tableName) 59 { 60 72 return "SELECT SCOPE_IDENTITY()"; 73 } 74 75 78 protected String getConcatenationCharacter() 79 { 80 return "+"; 81 } 82 83 } 84 | Popular Tags |