import java.net.url;
import java.sql.*;
public class javaoracle {
public javaoracle() {
}
public static void main(string[] args){
try
{
try{
class.forname("oracle.jdbc.driver.oracledriver");
}
catch(java.lang.classnotfoundexception e)
{
system.err.print(e.getmessage());
}
string url="jdbc:oracle:thin:@server:1521:sdcdb";
connection conn=drivermanager.getconnection(url,"test","test");
statement stmt=conn.createstatement();
resultset rs=stmt.executequery("select score from my");
while(rs.next())
{
system.out.println(rs.getstring(1));
}
conn.close();
}
catch(sqlexception ex)
{
while(ex!=null)
{system.out.println(ex.getsqlstate());
}
}
}
}