Notes
![]() ![]() Notes - notes.io |
package net.sourceforge.tess4j.example;
import com.lowagie.text.pdf.ArabicLigaturizer;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
public class connection {
private String kullanıcı_adı="root";
private String parola="";
private String db_name="ocr";
private String host="localhost";
private int port=3306;
private Connection con=null;
private Statement statement=null;
private PreparedStatement prepare=null;
private Statement state;
public connection() {
String url="jdbc:mysql://"+host+":"+port+"/"+db_name+"?useUnicode=true&characterEncoding=utf8";
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException ex) {
Logger.getLogger(connection.class.getName()).log(Level.SEVERE, null, ex);
}
try {
con=DriverManager.getConnection(url, kullanıcı_adı, parola);
System.out.println("bağlantı başaralı ");
} catch (SQLException ex) {
Logger.getLogger(connection.class.getName()).log(Level.SEVERE, null, ex);
System.out.println("bağlantı başarısız");
}
}
public ArrayList<market> listele(){
ArrayList<market> cikti = new ArrayList<market>();
try {
state =(Statement) con.createStatement();
String sorgu = "SELECT * from market";
ResultSet rs = state.executeQuery(sorgu);
while(rs.next()){
String firma_adi = rs.getString("İsletmeAdı");
String tarih = rs.getString("Tarih");
String fıs = rs.getString("FişNo");
String urunler = rs.getString("Ürünler");
String toplam = rs.getString("ToplamFiyat");
cikti.add(new market(firma_adi, tarih, fıs, urunler, toplam));
}
return cikti;
} catch (SQLException ex) {
Logger.getLogger(connection.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
}
public ArrayList<market> listele_sirket(String sirketismi){
ArrayList<market> cikti = new ArrayList<market>();
try {
state =(Statement) con.createStatement();
String sorgu = "SELECT * from market where İsletmeAdı="+"'"+sirketismi+"'";
ResultSet rs = state.executeQuery(sorgu);
while(rs.next()){
String firma_adi = rs.getString("İsletmeAdı");
String tarih = rs.getString("Tarih");
String fıs = rs.getString("FişNo");
String urunler = rs.getString("Ürünler");
String toplam = rs.getString("ToplamFiyat");
cikti.add(new market(firma_adi, tarih, fıs, urunler, toplam));
}
return cikti;
} catch (SQLException ex) {
Logger.getLogger(connection.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
}
public ArrayList<market> listele_tarih(String tarihgelen){
ArrayList<market> cikti = new ArrayList<market>();
try {
state =(Statement) con.createStatement();
String sorgu = "SELECT * from market where Tarih="+"'"+tarihgelen+"'";
ResultSet rs = state.executeQuery(sorgu);
while(rs.next()){
String firma_adi = rs.getString("İsletmeAdı");
String tarih = rs.getString("Tarih");
String fıs = rs.getString("FişNo");
String urunler = rs.getString("Ürünler");
String toplam = rs.getString("ToplamFiyat");
cikti.add(new market(firma_adi, tarih, fıs, urunler, toplam));
}
return cikti;
} catch (SQLException ex) {
Logger.getLogger(connection.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
}
public void tabloya_ekle(String sirketismi,String tarih,String fis_no,String ürün,String toplam){
String sorgu="INSERT INTO market (İsletmeAdı,Tarih,FişNo,Ürünler,ToplamFiyat) VALUES (?,?,?,?,?)";
try {
//prepare= (com.mysql.jdbc.PreparedStatement) con.prepareStatement(sorgu);
prepare= (PreparedStatement) con.prepareStatement(sorgu);
prepare.setString(1, sirketismi);
prepare.setString(2, tarih);
prepare.setString(3, fis_no);
prepare.setString(4, ürün);
prepare.setString(5, toplam);
prepare.executeUpdate();
} catch (SQLException ex) {
Logger.getLogger(connection.class.getName()).log(Level.SEVERE, null, ex);
}
}}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team