On 8/26/2024 9:33 PM, Arne Vajhøj wrote:
On 8/26/2024 9:17 PM, Craig A. Berry wrote:
On 8/26/24 7:44 PM, Arne Vajhøj wrote:
This is surprisingly easy:
No surprise. It was easy with jTDS 15-20 years ago, but I think that
driver is deprecated now.
Looks like last release is from 2013.
But it may still work fine. TDS is a very old protocol.
It still works.
$ type jtds.groovy
import java.sql.*
con = DriverManager.getConnection("jdbc:jtds:sqlserver://arnepc5/Test",
"sa", "hemmeligt")
pstmt = con.prepareStatement("SELECT f1, f2 FROM t1")
rs = pstmt.executeQuery()
while(rs.next()) {
f1 = rs.getInt(1)
f2 = rs.getString(2)
printf("%d %s\n", f1, f2)
}
con.close()
$ groovy_cp = "jtds-1_3_1.jar"
$ groovy jtds.groovy
1 A
2 BB
3 CCC
Arne
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)