00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 import java.lang.*;
00025
00026 public class MSDJapi
00027 {
00028 public native int initMSDJapi();
00029 public native int rloginMSDJapi( java.lang.String loginstring );
00030 public native int attachMSDJapi( java.lang.String host );
00031 public native int beginMSDJapi( java.lang.String user, java.lang.String pass );
00032 public native int sqlinitMSDJapi( java.lang.String sql );
00033 public native int setcriteriaMSDJapi( java.lang.String fmt, java.lang.String[] arglist );
00034 public native int getrownumMSDJapi();
00035 public native int getnextMSDJapi();
00036 public native float getfloatMSDJapi(int col);
00037 public native int getintMSDJapi(int col);
00038 public native double getdoubletMSDJapi(int col);
00039 public native java.lang.String getstrMSDJapi(int col);
00040 public native int endMSDJapi();
00041 public native int detachMSDJapi();
00042 public native int logoffMSDJapi();
00043 public native int freeMSDJapi();
00044 public native int managerMSDJapi();
00045 public native java.lang.String getAccessionCodeMSDJapi(int eID);
00046 public native int getEntryIDMSDJapi(java.lang.String acc_code);
00047 public native int getObjectEntryMSDJapi(int eID);
00048 public native int getNumOfAtomsMSDJapi();
00049 public native int printfMSDJapi( java.lang.String text );
00050
00051
00052 public static void main( String args[] )
00053 {
00054 MSDJapi msdjapiObject = new MSDJapi();
00055
00056 java.lang.String statement="SELECT " +
00057 "a.chem_comp_code, a.Orig_x, a.Orig_y, a.Orig_z, " +
00058 "a.residue_id, a.residue_pdb_seq, a.residue_pdb_insert_code, a.chain_id, " +
00059 "a.chain_code, a.Non_Assembly_Valid " +
00060 "FROM atom_data a " +
00061 "WHERE a.assembly_id = 43472 " +
00062 "AND a.entry_id = :f<int> ";
00063 java.lang.String arg1 = new java.lang.String("38175");
00064 java.lang.String[] criteriaArgs = {arg1};
00065 int recnum, jj=0;
00066
00067 if( args.length < 3 ){
00068 msdjapiObject.printfMSDJapi( "Enter Oracle Host, Login name and Password." );}
00069 else {
00070
00071 msdjapiObject.initMSDJapi();
00072
00073 msdjapiObject.attachMSDJapi( args[0] );
00074
00075
00076 msdjapiObject.beginMSDJapi( args[1] , args[2] );
00077
00078
00079
00080
00081 msdjapiObject.sqlinitMSDJapi( statement );
00082 msdjapiObject.setcriteriaMSDJapi( "i", criteriaArgs );
00083
00084 recnum = msdjapiObject.getrownumMSDJapi();
00085 while (recnum < 26612 )
00086 { recnum = msdjapiObject.getrownumMSDJapi();
00087 msdjapiObject.getnextMSDJapi();
00088 if (recnum % 1000 == 0)
00089 {System.out.println("\nRecord number = " + recnum + "\nFloat Value = " + msdjapiObject.getfloatMSDJapi(1) +
00090 "\nString value = " + msdjapiObject.getstrMSDJapi(0)
00091 );
00092
00093 }
00094
00095 }
00096
00097
00098 }
00099
00100 System.out.println("\nACCESSION CODE for: " + msdjapiObject.getAccessionCodeMSDJapi(38175));
00101 System.out.println("\nEntry ID for: " + msdjapiObject.getEntryIDMSDJapi("1gw5"));
00102
00103 msdjapiObject.endMSDJapi();
00104 msdjapiObject.detachMSDJapi();
00105 msdjapiObject.logoffMSDJapi();
00106 msdjapiObject.freeMSDJapi();
00107
00108
00109 }
00110
00111
00112 static
00113 {
00114
00115 String library = "MSDJapi";
00116 try
00117 {
00118
00119 System.loadLibrary( library );
00120
00121 }
00122 catch( Exception e )
00123 {
00124 System.out.println( "\nERROR: Unable to load " + library + "\nException: " + e + "\n" );
00125 }
00126 }
00127 }
00128
00129 class MSDEnv
00130 {
00131
00132 private int ConID;
00133
00134 public void setConID(int lcl_arg0)
00135 {
00136 ConID = lcl_arg0;
00137 }
00138 public int getConID()
00139 {
00140 return ConID;
00141 }
00142
00143 private int SqlID;
00144
00145 public void setSqlID(int lcl_arg0)
00146 {
00147 SqlID = lcl_arg0;
00148 }
00149 public int getSqlID()
00150 {
00151 return SqlID;
00152 }
00153 private native static void initFIDs();
00154
00155 static {
00156 initFIDs();
00157 }
00158
00159 }
00160
00161
00162