Package org.mcisb.db.sql

Examples of org.mcisb.db.sql.StatementExecutor


   
   
   
    try {
      Connection connection = DriverManager.getConnection (url);
      StatementExecutor statementExecutor = new StatementExecutor(connection);
     
      //Set up a couple of objects and references
      experimentalDetails = new ExperimentalDetails();
      Dish myDish = new Dish(1);
      Microscope myMicroscope = null;
      // Let's get the recordings.. (Each one's an individual field or spot)
     
      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++) {
        List recordingsDataRow = (List)recordingsData.get(i);
        String lsmFileNameBuffer=(String)recordingsDataRow.get(SAMPLE_DATA);
        File lsmFile = new File(lsmFileNameBuffer);
        SpotReading newSpot = new SpotReading();
        newSpot.setResultFile(convertFileName(lsmFile.getAbsolutePath(), mdbFile.getAbsolutePath()));
        newSpot.setAcquisitionTime((Timestamp)recordingsDataRow.get(ACQUISITION_TIME));
        String recordingId = recordingsDataRow.get(RECORDING_ID).toString();

        //Deal with the excitations! (lasers)
        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++){
          List lasersDataRow=(List)lasersData.get(j);
          Excitation excitation = new Excitation((String)lasersDataRow.get(LASER_ID), ((Double)lasersDataRow.get(LASER_POWER)).doubleValue());
          newSpot.addExcitation(excitation);
        }
        //Deal with the tracks! (tracks) - I'm so funny, I just kill myself.
       
        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);
          Track track = new Track();
          track.setID(tracksDataRow.get(TRACK_ID).toString());
View Full Code Here


      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() );
View Full Code Here

TOP

Related Classes of org.mcisb.db.sql.StatementExecutor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.