Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Connection getdataconnet() {
- Connection connect = null;
- try {
- Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
- connect = DriverManager.getConnection("jdbc:derby:APPDATA", "xxxx", "xxxxxxxxxxxxxxx");
- } catch (ClassNotFoundException ex) {
- globalData.GlobalDataSetGet.OLD_USER = -1;
- ////JOptionPane.showMessageDialog(null, "1"+ex);
- } catch (SQLException ex) {
- globalData.GlobalDataSetGet.OLD_USER = -1;
- ////JOptionPane.showMessageDialog(null, "2"+ex);
- }
- return connect;
- }
- Connection connect = null;
- Path currentRelativePath = Paths.get("");
- String s = currentRelativePath.toAbsolutePath().toString();
- try {//DriverManager.getConnection("jdbc:derby:"+System.getProperty("user.dir")+"/APPDATA", "#####", "#############");
- connect = DriverManager.getConnection("jdbc:derby:"+s+"/APPDATA", "#####", "#############");
- } catch (ClassNotFoundException ex) {
- globalData.GlobalDataSetGet.OLD_USER = -1;
- JOptionPane.showMessageDialog(null, "1"+ex);
- } catch (SQLException ex) {
- globalData.GlobalDataSetGet.OLD_USER = -1;
- JOptionPane.showMessageDialog(null, "2"+ex);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement