@@ -0,0 +1,1329 @@
+package connectionDB;%0A%0A%0Aimport java.sql.Connection;%0Aimport java.sql.DriverManager;%0A%0Aimport javax.swing.JOptionPane;%0A%0A%0A/**%0A * Created by dimsan on 07.11.2015.%0A */%0Apublic class DbConnection %7B%0A    Connection  con= null;%0A    public static Connection ConnectDb()%7B%0A%0A        try%7B%0A%0A            Class.forName(%22org.sqlite.JDBC%22);%0A            String dir = System.getProperty(%22user.dir%22);%0A            String dbUrl=%22jdbc:sqlite:dir%5C%5CProjectListOfCars.sqlite%22;%0A            Connection con = DriverManager.getConnection(dbUrl);%0A            //JOptionPane.showMessageDialog(null,%22%D0%A1%D0%BE%D0%B5%D0%B4%D0%B8%D0%BD%D0%B5%D0%BD%D0%B8%D0%B5 %D1%81 %D0%B1%D0%B0%D0%B7%D0%BE%D0%B9 %D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BB%D0%B5%D0%BD%D0%BE%22);%0A            return con;%0A%0A        %7Dcatch(Exception e)%7B%0A            JOptionPane.showMessageDialog(null,%22%D0%9E%D1%88%D0%B8%D0%B1%D0%BA%D0%B0 %D1%81%D0%BE%D0%B5%D0%B4%D0%B8%D0%BD%D0%B5%D0%BD%D0%B8%D1%8F %D1%81 %D0%B1%D0%B0%D0%B7%D0%BE%D0%B9%22);%0A            return null;%0A        %7D%0A%0A    %7D%0A    public static Connection ConnectDb(String name)%7B%0A%0A        try%7B%0A            Class.forName(%22org.sqlite.JDBC%22);%0A            String dir = System.getProperty(%22user.dir%22);%0A            String dbUrl=%22jdbc:sqlite:dir%5C%5C%22+name+%22.sqlite%22;%0A            Connection con = DriverManager.getConnection(dbUrl);%0A            //JOptionPane.showMessageDialog(null,%22%D0%A1%D0%BE%D0%B5%D0%B4%D0%B8%D0%BD%D0%B5%D0%BD%D0%B8%D0%B5 %D1%81 %D0%B1%D0%B0%D0%B7%D0%BE%D0%B9 %D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BB%D0%B5%D0%BD%D0%BE%22);%0A            return con;%0A%0A        %7Dcatch(Exception e)%7B%0A            JOptionPane.showMessageDialog(null,%22%D0%9E%D1%88%D0%B8%D0%B1%D0%BA%D0%B0, %D0%B1%D0%B0%D0%B7%D0%B0 %D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85 %D0%BD%D0%B5 %D0%BD%D0%B0%D0%B9%D0%B4%D0%B5%D0%BD%D0%B0%22);%0A            return null;%0A        %7D%0A%0A    %7D%0A%0A%7D

add Connection