home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.disi.unige.it
/
2015-02-11.ftp.disi.unige.it.tar
/
ftp.disi.unige.it
/
pub
/
.person
/
MesitiM
/
teach
/
templateJava.java
< prev
Wrap
Text File
|
2003-06-10
|
959b
|
42 lines
// Cognome e Nome:
// Numero di matricola:
// Data di Nascita:
// login su SQL server:
// Password su SQL server:
import java.sql.*;
import java.io.*;
class templateJavaEsame
{
// subname deve essere sostituito con l'identificatore ODBC creato
static String Con_URL = "jdbc:odbc:subname";
public static void main (String args [])
{
Connection con = null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// inserire codice
}
catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
catch (SQLException e) {
while( e!=null){
System.out.println("SQLState: " + e.getSQLState());
System.out.println(" Code: " + e.getErrorCode());
System.out.println(" Message: " + e.getMessage());
e = e.getNextException();
}
}
}
}