final int TRACK_NAME = 1;
final String url = "jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=" + mdbFile.getAbsolutePath(); //$NON-NLS-1$
// final String url = "jdbc:easysoft://localhost/Driver={MicroSoft Access Driver (*.mdb)};DBQ=" + mdbFile.getAbsolutePath(); //$NON-NLS-1$
final Connection connection = DriverManager.getConnection( url );
final StatementExecutor statementExecutor = new StatementExecutor( connection );
final List recordingsData = statementExecutor.getValues( Arrays.asList( new String[] { "Recordings.IDRecording", "Recordings.Sample0Time", "Recordings.IDAvailableObjective", "Recordings.SampleData" } ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
for( int i = 0; i < recordingsData.size(); i++ )
{
final List recordingsDataRow = (List)recordingsData.get( i );
final String lsmFileNameBuffer = (String)recordingsDataRow.get( SAMPLE_DATA );
final File lsmFile = new File( lsmFileNameBuffer );
// F-Fluar 40x/1.3 Oil ==> name: F-Fluar Oil, lensNA: 1.3, magnification: 40x
final String[] components = ( (String)recordingsDataRow.get( OBJECTIVE ) ).split( "\\s" ); //$NON-NLS-1$
final String[] tmpBuf = components[1].split( "/" ); //$NON-NLS-1$
// recording.setName( components[ 0 ] + " " + components[ 2 ] );
final java.util.Date aquisitionTime = (Timestamp)recordingsDataRow.get( AQUISITION_TIME );
final String lensNA = tmpBuf[ 1 ];
final String magnification = tmpBuf[ 0 ];
final String recordingId = recordingsDataRow.get( RECORDING_ID ).toString();
final String name = convertFileName( lsmFile.getAbsolutePath(), mdbFile.getAbsolutePath() );
final MicroscopeRecording recording = new MicroscopeRecording( name, aquisitionTime.toString(), lensNA, magnification );
recording.setLensName(components[0]+" "+components[2]); //$NON-NLS-1$
final List lasersData = statementExecutor.getValues( Arrays.asList( new String[] { "Lasers.IdAvailableLaser", "Lasers.Power" } ), Arrays.asList( new String[] { "Lasers.IDrecording=" + recordingId } ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
for( int j = 0; j < lasersData.size(); j++ )
{
final List lasersDataRow = (List)lasersData.get( j );
final Laser laser = new Laser( (String)lasersDataRow.get( LASER_ID ), ( (Double)lasersDataRow.get( LASER_POWER ) ).doubleValue() );
recording.add( laser );
}
final List tracksData = statementExecutor.getValues( Arrays.asList( new String[] { "Tracks.IDTrack", "Tracks.TrackName" } ), Arrays.asList( new String[] { "Tracks.IDrecording=" + recordingId } ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
for( int j = 0; j < tracksData.size(); j++ )
{
final List tracksDataRow = (List)tracksData.get( j );
UniqueObject track = new UniqueObject( tracksDataRow.get( TRACK_ID ).toString() );