Hi,
Is there a way in JAVA to retrieve the return value of a User Defined Function, designed in my MSSQL database.
udf_RetrieveDienstNaam = User Defined Function from my database.
String sql = "{? = call dbo.udf_RetrieveDienstNaam(1)}";
ResultSet rs;
Connection con;
MedocConnectDB cDB = new MedocConnectDB();
try{
con = cDB.getConnection();
if (con!=null){
CallableStatement cstmt = con.prepareCall(sql);
cstmt.registerOutParameter(1, java.sql.Types.VARCHAR );
rs = cDB.execute();
rs.next();
String dbUser = rs.getString(1);
System.out.println(dbUser);
rs.close();
rs = null;
}
con.close();
}catch(Exception e){
}
Live fast, die young and leave a beautiful corpse behind.
Is there a way in JAVA to retrieve the return value of a User Defined Function, designed in my MSSQL database.
udf_RetrieveDienstNaam = User Defined Function from my database.
String sql = "{? = call dbo.udf_RetrieveDienstNaam(1)}";
ResultSet rs;
Connection con;
MedocConnectDB cDB = new MedocConnectDB();
try{
con = cDB.getConnection();
if (con!=null){
CallableStatement cstmt = con.prepareCall(sql);
cstmt.registerOutParameter(1, java.sql.Types.VARCHAR );
rs = cDB.execute();
rs.next();
String dbUser = rs.getString(1);
System.out.println(dbUser);
rs.close();
rs = null;
}
con.close();
}catch(Exception e){
}
Live fast, die young and leave a beautiful corpse behind.