在 JavaFX Eclipse 中验证文本数据输入为数字和非数字混合而不是非数字[重复]

问题描述 投票:0回答:1

需要验证文本框中输入的数据为:

  1. 纯数字,例如:1325654
  2. 或混合,例如:Wa4433 但不是纯粹的非数字,例如:AbcdE,

如何验证?

eclipse validation javafx text textbox
1个回答
0
投票

我的脑海中存在一个误解,认为 jdbc:sqlite: 会在安装应用程序的同一文件夹中自动创建数据库文件。但是,安装任何应用程序的文件夹都受到写保护。以下对我有用:

public static Connection getConnection() {      
    Connection conn = null;

        try{        
            
                File theDir = new File( "c://spm_database");
                if (!theDir.exists()){
                    theDir.mkdirs();
                }
                System.out.println(theDir.toString());
                String dbpath = theDir.toString()+"/patientdata.db";
                System.out.println("Current absolute dbpath is: " + dbpath);
                
                Class.forName("org.sqlite.JDBC");
                conn = DriverManager.getConnection("jdbc:sqlite:"+dbpath);
                System.out.println("data base connection established:  "+ conn.toString());
               // extra code .....
           }
           catch(Exception e){
            }
           retrun conn
         }
             
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.