Android Question Error using library: mssql-jdbc-7.0.0.jre8.jar

enccap

New Member
Licensed User
Hello, I'm a new user of B4A to learn B4J.

I insert my project becouse when I compile that it returns me this error:
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version> = 26)

In my project I add this instruction
#AdditionalJar: mssql-jdbc-7.0.0.jre8.jar

In Starter procedure I added the following instructions to run a SQLServer store procedure.
That updates return error at the compiling



------ instructions added in Starter procedure

'start transaction
MioDBSQL.BeginTransaction

'update using JdbcSQL ExecQuery
MioSQL = "UPDATE movmag"
MioSQL = MioSQL + "SET mm_colli =" + MovCommsCls.Colli + ", mm_quant =" + MovCommsCls.Quantita
MioSQL = MioSQL + "FROM movmag"
MioSQL = MioSQL + "WHERE movmag.mm_commeca =" + CommsRic + "AND movmag.mm_tipork = 'T' AND movmag.mm_numdoc =" + MovCommsCls.NumDoc
Log ($ "MioSQL:" $ {MioSQL} "$)
MioDBSQL.ExecNonQuery (MioSQL)
Try
Success = True
Catch
Log (LastException)
End Try
'activate the Store Procedure - dbo.bussp_aggartpro9 - with JdbcSQL
MSSQLProcedure.ProcedureCall = "{call dbo.bussp_aggartpro9 (?,?,?,?,?,?,?,?)}"
'Set parameters Store Procedure - JdbcSQL
MSSQLProcedure.AddInputParameter (1, MSSQLProcedure.SQLVARCHAR, "T")
MSSQLProcedure.AddInputParameter (2, MSSQLProcedure.SQLSMALLINT, MovCommsCls.Anno)
MSSQLProcedure.AddInputParameter (3, MSSQLProcedure.SQLVARCHAR, MovCommsCls.Serie)
MSSQLProcedure.AddInputParameter (4, MSSQLProcedure.SQLINTEGER, MovCommsCls.NumDoc)
MSSQLProcedure.AddInputParameter (5, MSSQLProcedure.SQLSMALLINT, "1")
MSSQLProcedure.AddInputParameter (6, MSSQLProcedure.SQLDATE, "01/01/" + MovCommsCls.Anno)
MSSQLProcedure.AddInputParameter (7, MSSQLProcedure.SQLINTEGER, "6")
MSSQLProcedure.AddInputParameter (8, MSSQLProcedure.SQLVARCHAR, MovCommsCls.Codditt)
'execute Store Procedure with JdbcSQL
MSSQLProcedure.ExecProcedure (MioDBSQL) 'MSSQLConnection)

MyResultSet = MSSQLProcedure.FetchResultSet

'end transaction
MioDBSQL.TransactionSuccessful

------------------ End of instructions added in Starter




--------- Changes made to the Manifest file

AddManifestText(
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)

--------- End of changes made to the Manifest file




Thanks

Enrico
 

Attachments

  • BarigSQL.zip
    30 KB · Views: 300

OliverA

Expert
Licensed User
Longtime User
MS JDBC drivers do not work with Android. May not be the cause of the error message, but will cause errors beyond that
 
Upvote 0
Top