PowerBuilder Connect SQLite Using JDBC
Step 1: Get driver JDBC SQLite sqlite-jdbc-X.X.X.jar from page : https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc
Step 2: Set Class Path driver to environment variables or set class path to runtime of java
Step 3: Test Connect
Step 4: Copy jre current version of java to your pbapp runtime
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | String ls_path, ls_classpath Boolean lb_jvm_started, lb_debug javavm ljvm ls_path = GetCurrentDirectory ( ) // set classpath or you can environment variables of window ls_classpath = ls_path + "\sqlite-jdbc-3.32.3.2.jar" If Not FileExists(ls_classpath) Then MessageBox('Warning',"driver class file not exists") Return End If If Not lb_jvm_started Then ljvm = Create javavm //using pbejbclientXXX.pbd Choose Case ljvm.createJavaVM(ls_classpath, lb_debug) Case 0 lb_jvm_started = True Case -1 MessageBox('Warning',"Failed to load JavaVM") Return Case -2 MessageBox('Warning',"Failed to load EJBLocator") Return End Choose End If // get infor String ls_dbSQLite ls_dbSQLite = "C:\sqlite.db" //sqlite.sqlite //connect Transaction ltran_conn ltran_conn = Create Transaction ltran_conn.DBMS = "JDBC" ltran_conn.AutoCommit = False ltran_conn.DBParm = "Driver='org.sqlite.JDBC',URL='jdbc:sqlite:"+ls_dbSQLite+"'" Connect Using ltran_conn ; If ltran_conn.SQLCode = -1 Then MessageBox('Warning','Connect Database Error' + ltran_conn.SQLErrText) Else MessageBox('Warning',"Connect Success!") End If Disconnect Using ltran_conn ; |
Find Projects On Github click here
Good Luck!
Catalog tables could not be created and are not available for use.
no problem happened. you edit in the .ini file to pass the warning. still in normal use. you can manually create the tables PBCATTBL
PBCATCOL
PBCATFMT
PBCATVLD
PBCATET
There is no work around this error in case if want to use any DB DDL,or piplines
PB will always use “public” as tables owner. if someone could make it do operations without this owner thing