Advertisement
Guest User

Untitled

a guest
Sep 16th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.59 KB | None | 0 0
  1. import java.io.FileOutputStream;
  2. import java.io.IOException;
  3. import java.io.InputStream;
  4. import java.io.OutputStream;
  5. import java.sql.Blob;
  6. import java.sql.Connection;
  7. import java.sql.DriverManager;
  8. import java.sql.PreparedStatement;
  9. import java.sql.ResultSet;
  10. import java.sql.SQLException;
  11.  
  12. public class webaruhaz
  13. {
  14.     private static final int buffersize = 4096;
  15.    
  16.    
  17.     public static void main(String[] args) {
  18.        
  19.         String url = "jdbc:mysql://localhost:3306/contactdb";
  20.         String user = "root";
  21.         String password = "secret";
  22.        
  23.        
  24.         public class file{     //// file megnyitás
  25.            
  26.             private Scanner in;
  27.            
  28.             public void fileOpen(){
  29.                
  30.                 try{
  31.                     in = new Scanner(new File("Basket.txt"));
  32.                 }
  33.                 catch(Excetption e){
  34.                     System.out.println("Could not find file!");
  35.                 }
  36.             }
  37.            
  38.             public void fileRead(){   //// adatolvasás
  39.                 while(in.hasNext()){
  40.                    
  41.                     int trxId = in.next();
  42.                    
  43.                     int itemId = in.next();
  44.                     short quantity = in.next();
  45.                     String itemName = in.next();
  46.                     String description = in.next();                
  47.                 }
  48.             }
  49.             public void fileClose(){
  50.                 in.close();
  51.             }
  52.            
  53.             public void fileOpenEnd(){
  54.                
  55.                 private Scanner out;
  56.                
  57.                 try{
  58.                     out = new Scanner(new File("Sale.txt"));
  59.                 }
  60.                 catch(Excetption e){
  61.                     System.out.println("Could not find file!");
  62.                 }
  63.             }
  64.            
  65.             public void addReceipt(){
  66.                
  67.                
  68.                
  69.                 out.format("%s%s","trxId","summ")   //// ez adja meg a végösszeget
  70.             }
  71.            
  72.             public void fileClose(){
  73.                 out.close();
  74.            
  75.         }
  76.        
  77.        
  78.        
  79.        
  80.        
  81.        
  82.        
  83.        
  84.     }
  85.    
  86.    
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement