Hello
I'm starting to work with a web application using SQL Plugin to connect to an
Oracle database.
I't is terrible slow, so i copied the same code to a console app and tried it.
It's fast!
Do you know if there is any problem with SQL + Web? Any workaround? Anything
i'm doing bad?
My tests are simple, run a query and populate a listbox. The following code is
the one i run in the console app and is copied from the web app and changed to
use print instead listbox…
This query returns 15000 records. The slowness is not populating the listbox,
is executing the query.
This is on a Mac running Xojo 2013r3 + Plugin 13.3 and the database is 11gR2 on
a Linux server on a good switch Gigabit Ethernet LAN (remember, the console one
runs fast!)
Best,
The code:
Dim Server,UserID,Password As String
Dim con as SQLConnectionMBS
server = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST="+"__HOST__"+")"+ _
"(PORT="+"1521"+"))"+ _
"(CONNECT_DATA=(SID="+"__SID__"+")))"
userID = "__AN_USER__"
password = "__A_PASSWORD__"
con = new SQLConnectionMBS
try
con.Connect(server, userID, password, SQLConnectionMBS.kOracleClient)
MsgBox("Connected to Oracle!")
catch r as RuntimeException
// Error !!!
MsgBox("Exception: Database connection: "+r.message)
end try
dim SQLQuery as SQLCommandMBS
SQLQuery = new SQLCommandMBS
SQLQuery.Connection=con
SQLQuery.setCommandText("SELECT field1,field2,field3 FROM TABLE where
field1='t047011' and field2='m3' order by field1,field3")
SQLQuery.Execute
MsgBox("Query executed")
if SQLQuery.FetchNext then
do
// In web, I populate a listbox
print SQLQuery.Field("field1").asStringValue
print SQLQuery.Field("field2").asStringValue
print SQLQuery.Field("field3").asDateTime.StringValue
loop until not SQLQuery.FetchNext
else
MsgBox("No records selected!")
end if
--
José María Terry Jiménez
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info