Beruflich Dokumente
Kultur Dokumente
profile ;
import java.sql.Connection ;
import java.sql.PreparedStatement ;
import java.sql.ResultSet ;
import java.sql.SQLException ;
import oracle.adf.model.datacontrols.device.DeviceManager ;
import
oracle.adf.model.datacontrols.device.DeviceManagerFactory ;
import oracle.adfmf.framework.api.AdfmfContainerUtilities ;
import oracle.adfmf.framework.api.AdfmfJavaUtilities ;
import oracle.adfmf.framework.api.AdfmfSlidingWindowOptions ;
import oracle.adfmf.framework.api.AdfmfSlidingWindowUtilities ;
import oracle.adfmf.java.beans.PropertyChangeListener ;
import oracle.adfmf.java.beans.PropertyChangeSupport ;
return profile ;
}
return conn ;
}
getPicture( DeviceManager.CAMERA_SOURCETYPE_PHOTOLIBRARY
);
}
if ( conn != null )
{
try
{
PreparedStatement stat =
conn.prepareStatement( "SELECT * FROM
PROFILE" ) ;
ResultSet rs = stat.executeQuery() ;
// row exists, then update
if ( rs.next() )
{
PreparedStatement stmt =
conn.prepareStatement( "UPDATE PROFILE
SET FIRST_NAME = ? , LAST_NAME = ? , EMAIL = ? , MOBILE = ? ,
IMAGE = ? , DEPARTMENT = ?" ) ;
stmt.setString( 1 , profile.getFirstName() ) ;
stmt.setString( 2 , profile.getLastName() ) ;
stmt.setString( 3 , profile.getEmail() ) ;
stmt.setString( 4 ,
profile.getMobileNumber() ) ;
stmt.setString( 5 , profile.getPhoto() ) ;
stmt.setString( 6 , profile.getDepartment() ) ;
stmt.executeUpdate() ;
conn.commit() ;
}
// row doesn't exists, then create
else
{
PreparedStatement stmt =
conn.prepareStatement( "INSERT INTO
PROFILE ('FIRST_NAME', 'LAST_NAME' , 'EMAIL' , 'MOBILE' , 'IMAGE' ,
'DEPARTMENT') values (?,?,?,?,?,?);" ) ;
stmt.setString( 1 , profile.getFirstName() ) ;
stmt.setString( 2 , profile.getLastName() ) ;
stmt.setString( 3 , profile.getEmail() ) ;
stmt.setString( 4 ,
profile.getMobileNumber() ) ;
stmt.setString( 5 , profile.getPhoto() ) ;
stmt.setString( 6 , profile.getDepartment() ) ;
stmt.executeUpdate() ;
conn.commit() ;
}
}
catch ( Exception e )
{
AdfmfContainerUtilities.invokeContainerJavaScriptFunction( AdfmfJ
avaUtilities.getFeatureId() ,
hideProfilePage() ;
}
}
if ( this.windowId == null )
this.setWindowId( AdfmfSlidingWindowUtilities.create( "hr.mobile.bo
otcamp.UserProfile" ) ) ;
AdfmfSlidingWindowOptions windowOptions =
new AdfmfSlidingWindowOptions() ;
windowOptions.setDirection( AdfmfSlidingWindowOptions.DIRECTIO
N_BOTTOM ) ;
windowOptions.setStyle( AdfmfSlidingWindowOptions.STYLE_OVERL
AID ) ;
windowOptions.setDuration( 500 ) ;
windowOptions.setSize( "100%" ) ;
AdfmfSlidingWindowUtilities.show( getWindowId() ,
windowOptions ) ;
AdfmfSlidingWindowUtilities.hide( getWindowId() ) ;
}