Sujet : Re: Accessing MS SQLServer from VMS in a JVM language
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 27. Aug 2024, 02:46:16
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <66cd2fe9$0$719$14726298@news.sunsite.dk>
References : 1 2 3
User-Agent : Mozilla Thunderbird
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