import java.net.*;
import java.sql.*;
import java.io.*;
import java.util.*;
class MakeDB
{
public static void main (String args[])
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // force loading of driver
String url = "jdbc:odbc:AMINO";
String user = "";
String password = "";
Connection con = DriverManager.getConnection(url,user,password);
Statement stmt = con.createStatement();
stmt.executeUpdate("CREATE TABLE AMINO_ABBREV (AMINO_NAME VARCHAR(13), ONE_LTR VARCHAR(1), THREE_LTR VARCHAR(3))");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Alanine', 'A', 'Ala')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Arginine', 'R', 'Arg')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Asparigine', 'N', 'Asn')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Aspartic Acid', 'D', 'Asp')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Cysteine', 'C', 'Cys')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Glutamine', 'Q', 'Gln')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Glutamic Acid', 'E', 'Glu')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Glcyine', 'G', 'Gly')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Histidine', 'H', 'His')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Isoleucine', 'I', 'Ile')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Leucine', 'L', 'Leu')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Lysine', 'K', 'Lys')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Methionine', 'M', 'Met')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Phenylalanine', 'F', 'Phe')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Proline', 'P', 'Pro')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Serine', 'S', 'Ser')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Threonine', 'T', 'Thr')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Tryptophan', 'W', 'Trp')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Tyrosine', 'Y', 'Tyr')");
stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Valine', 'V', 'Val')");
ResultSet r = stmt.executeQuery("SELECT AMINO_NAME, ONE_LTR, THREE_LETTER FROM AMINO_ABBREV");
System.out.println("**ResultSet created");
while(r.next())
{
String aminoName = r.getString("AMINO_NAME");
String oneLtr = r.getString("ONE_LTR");
String threeLtr = r.getString("THREE_LTR");
String spcr = " ";
System.out.println(aminoName + " " + oneLtr + " " + threeLtr);
}
/*stmt.executeUpdate("INSERT INTO AMINO_ABBREV VALUES('Selenocysteine', 'U', 'Sec')");
r=stmt.executeQuery("SELECT AMINO_NAME, ONE_LTR, THREE_LETTER FROM AMINO_ABBREV WHERE AMINO_NAME < 'Phenylalanine'");
while(r.next())
{
String aminoName = r.getString("AMINO_NAME");
String oneLtr = r.getString("ONE_LTR");
String threeLtr = r.getString("THREE_LTR");
String spcr = " ";
System.out.println(aminoName + " " + oneLtr + " " + threeLtr);
}*/
stmt.close();
con.close();
}
catch (Exception ex)
{
System.out.println ("Exception "+ ex);
}
}
}