Create SQLiteConnection.java
This commit is contained in:
parent
629703663d
commit
c4d25f7269
21
apka_StolowkaZPM/src/SQLiteConnection.java
Normal file
21
apka_StolowkaZPM/src/SQLiteConnection.java
Normal file
@ -0,0 +1,21 @@
|
||||
import java.sql.*;
|
||||
//import javax.swing.*;
|
||||
import java.sql.Connection;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
public class SQLiteConnection
|
||||
{
|
||||
Connection conn=null;
|
||||
|
||||
public static Connection dbConnector() {
|
||||
try {
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
Connection conn=DriverManager.getConnection("jdbc:sqlite:stolowkaZPM.db");
|
||||
JOptionPane.showMessageDialog(null, "połączono !!!!");
|
||||
return conn;
|
||||
} catch (Exception e) {
|
||||
JOptionPane.showMessageDialog(null, "nie");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user