TechDoc db: karls




Our website wants to use Cookies  


JVM Version change & BSP

ID_BQH9NAHWNV67
Problem
Cannot run program "/usr/lib/jvm/java-17-openjdk/bin/java" (in directory "..."): error=2, No such file or directory
Solution Check config file .bsp/sbt.json and update reference to jvm version
JDBC ResultSet Fetch Size

ID_MXQBYAT33Y6M
To prevent Out of Memory Errors in JVM when receiving extensive, large ResultSets from JDBC queries, it can help to not only set FetchSize on Prepared Statement Level, but also defaultRowFetchSize on JDBC Driver Level. Depending on the used database system and driver, this may vary.
PreparedStatement Level:
ps.setFetchDirection( ResultSet.FETCH_FORWARD )
ps.setFetchSize( 1000 )

JDBC Driver Level:
props.setProperty("defaultRowFetchSize", 1000)
val connection = java.sql.DriverManager.getConnection(url, props)
Minus Symbol within Patterns (RegExp)

ID_NHTE6VBB87GU
Minus Symbol must be escaped within character classes, e.g.
[A-Z\-]
but this is not needed (but doesn't harm either) in other use cases, such as
(?:eins|zwei|d-r-e-i)
Endless Repeat Command (Linux)

ID_PDU7YWPXCKXX
while(true); do echo abcdefgh ; date ; sleep 3; done
null.asInstanceOf[...]

ID_R6FVYFEURXPN
scala> null.asInstanceOf[Integer]
val res4: Integer = null

scala> null.asInstanceOf[Int]
val res5: Int = 0
(Int is a primitive type)
Upper Case, Lower Case Conversion (ABAP)

ID_T4PWJQEQQH41
to_upper( ... )   
or String Interpolation:
|{ ... case = upper }|

to_lower( ... )   
or String Interpolation:
|{ ... case = lower }|
Can't find jdk BSP_java-17-openjdk

ID_WDP6Y4VVJ3R6
Problem
Cannot start Scala compile server
Can't find jdk BSP_java-17-openjdk
Solution IntelliJ Settings -> Build, Execution, Deployment -> Compiler -> Scala Compiler -> Scala Compile Server -> Use compile server (checked); JVM: JDK: Select valid SDK (black font instead red font then).
Reboot when compile server problems persist.
Non-Capturing Group (RegExp)

ID_JJ1KK1RFB6J8
Beispiel mit Strings-Alternativen
(?:eins|zwei|drei)
Button Type "submit" by default (pitfall)

ID_G8MXJC6QDFVD
<button>...</button>
The default type is submit, with all consequences (forward form data to a GET or POST destination, if there is a surrounding form tag somewhere). That is by default:
<button type="submit">...</button>
It is not so obvious, and could be a pitfall in my eyes (I'd prefer the default would be type=button, then the literals would match).

A button with type button (and not automatically forwarding form data to an URL destination) you get with:

<button type="button">...</button>
"indented definitions expected"

ID_RPWLKJQM4JSM
After migrating to Scala 3, and starting using indentation syntax, You're receiving the error message
indented definitions expected

To solve this issue:
  • 1. In project/plugins.sbt
    comment out:
    // addSbtPlugin("ch.epfl.scala" % "sbt-scala3-migrate" % "0.5.1")
    
  • 2. reload sbt project
  • 3. recompile

Ulm, Germany
Phone: +49 (0) 731 14 399 046
Email: hartmut0407@googlemail.com
Powered by Cetalison bnka

IT Solutions im Bereich
Unternehmenssoftware & Linux