import com.almworks.sqlite4java.*;
import java.io.*;

public class KAHVE1 
{
public static void main(String arg[]) throws SQLiteException
{
SQLiteConnection db = new SQLiteConnection(new File("/temp"));
db.open(true);
db.exec("drop table if exists KAHVE");
db.exec("create table KAHVE(isim String,kot int,fiyat double,miktar int,toplam double)");
db.exec("insert into KAHVE values('Espresso',150,9.99,110,0);");
db.exec("insert into KAHVE values('Venezuella',173,12.99,57,0);");
db.exec("insert into KAHVE values('Brezilya',123,12.99,30,0);");
db.exec("insert into KAHVE values('Kolombia',111,15.99,20,0);");
db.exec("update KAHVE set toplam=fiyat*miktar;");
SQLiteStatement statement = db.prepare("select * from KAHVE");
String isim;
int kot;
double fiyat;
int miktar;
double toplam;
try {
      while (statement.step()) {
        isim=statement.columnString(0);
        kot=statement.columnInt(1);
        fiyat=statement.columnDouble(2);
        miktar=statement.columnInt(3);
        toplam=statement.columnDouble(4);
        System.out.print("0"+statement.getColumnName(0));
        System.out.print("1"+statement.getColumnName(1));
        System.out.print("KAHVE İSMİ = " + isim);
        System.out.print(" KOT = " + kot);
        System.out.print(" FİYAT = " + fiyat);
        System.out.print(" MİKTAR = " + miktar);
        System.out.println(" TOPLAM = " + toplam);
      }
    } finally {
      statement.dispose();
    }

}

} 