besoft Active Member Licensed User Longtime User Nov 30, 2015 #1 I have the following question: I am using jSql to work with Oracle database. Connects successfully. Even a successful refill the table with data. How to run a query for Insert record. Do I always have to re-connect to the Oracle database for each query? Conn string: Code: Copy conn.InitializeAsync("conn", "oracle.jdbc.driver.OracleDriver", _ "jdbc:oracle:thin:@//localhost:1521/xe","hr","xxxx") What is the best technique to establish connections with databases? Is it good to connect to the database at application startup? Does the connection is established at the request button?
I have the following question: I am using jSql to work with Oracle database. Connects successfully. Even a successful refill the table with data. How to run a query for Insert record. Do I always have to re-connect to the Oracle database for each query? Conn string: Code: Copy conn.InitializeAsync("conn", "oracle.jdbc.driver.OracleDriver", _ "jdbc:oracle:thin:@//localhost:1521/xe","hr","xxxx") What is the best technique to establish connections with databases? Is it good to connect to the database at application startup? Does the connection is established at the request button?
Erel B4X founder Staff member Licensed User Longtime User Nov 30, 2015 #2 besoft said: Do I always have to re-connect to the Oracle database for each query? Click to expand... No. ConnectionPool (from the jServer library) is very useful when connecting to remote databases. It will handle the remote connections automatically. This way you won't need to handle broken connections. You just need to initialize it and the call GetConnection to get the SQL object and call Close to return it to the pool. Upvote 0
besoft said: Do I always have to re-connect to the Oracle database for each query? Click to expand... No. ConnectionPool (from the jServer library) is very useful when connecting to remote databases. It will handle the remote connections automatically. This way you won't need to handle broken connections. You just need to initialize it and the call GetConnection to get the SQL object and call Close to return it to the pool.
besoft Active Member Licensed User Longtime User Nov 30, 2015 #3 To insert records into the database use: Code: Copy conn.ExecQueryAsync("SQL","insert into test (test, memo) values ('bla bla', 'memo')",Null) Is this method correct? What does it mean parameter Null in the end? Currently I have a problem with the selection of lines in tableview. I need information from the selected row in the text field. Do you have any advice? Upvote 0
To insert records into the database use: Code: Copy conn.ExecQueryAsync("SQL","insert into test (test, memo) values ('bla bla', 'memo')",Null) Is this method correct? What does it mean parameter Null in the end? Currently I have a problem with the selection of lines in tableview. I need information from the selected row in the text field. Do you have any advice?
eurojam Well-Known Member Licensed User Longtime User Dec 1, 2015 #4 the NULL means, that you don't pass arguments to the query, something like Code: Copy conn.ExecQueryAsync( "SQL","insert into test (test, memo) values (?,?)",Array As String("bla bla", "memo")) Upvote 0
the NULL means, that you don't pass arguments to the query, something like Code: Copy conn.ExecQueryAsync( "SQL","insert into test (test, memo) values (?,?)",Array As String("bla bla", "memo"))