This commit is contained in:
2024-08-07 09:16:27 -04:00
parent fdfadd5c7e
commit 5f971cf684
5200 changed files with 731717 additions and 0 deletions

2
java/JDBCTest/JDBC.map Normal file
View File

@@ -0,0 +1,2 @@
VERSION: 1
jdbc.java,4,43,JDBC

14
java/JDBCTest/JDBC.ppj Normal file
View File

@@ -0,0 +1,14 @@
sun.jws.version.2
sun.jws.exceptions=List
break always : java.lang.ArithmeticException
break always : java.lang.ArrayIndexOutOfBoundsException
break always : java.lang.ArrayStoreException
break always : java.lang.ClassCastException
break always : java.lang.IllegalArgumentException
break always : java.lang.IllegalMonitorStateException
break always : java.lang.IndexOutOfBoundsException
break always : java.lang.NegativeArraySizeException
break always : java.lang.NullPointerException
break always : java.util.EmptyStackException
break always : java.util.NoSuchElementException
EndOfList

10
java/JDBCTest/JDBC.prj Normal file
View File

@@ -0,0 +1,10 @@
sun.jws.version.2
sun.jws.run.jdk.version=1.2
sun.jws.projectroot=.
sun.jws.classdir=classes
sun.jws.options=-g
sun.jws.classname=JDBC
sun.jws.type=standalone
sun.jws.files=List
jdbc.java
EndOfList

Binary file not shown.

44
java/JDBCTest/jdbc.java Normal file
View File

@@ -0,0 +1,44 @@
import java.sql.*;
import java.util.*;
public class JDBC
{
public JDBC ()
{
}
public static void main(String args[])
{
String url="jdbc:odbc:Dive";
Connection con;
String query="select StockSymbol from Stocks";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(java.lang.ClassNotFoundException e)
{
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try
{
con=DriverManager.getConnection(url,"sa","");
Statement stmt=con.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next())
{
String s = rs.getString("StockSymbol");
// float f = rs.getFloat("PRICE");
System.out.println(s);
}
}
catch(java.sql.SQLException exception)
{
exception.printStackTrace();
}
}
}