Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Java

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Java

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.sql.

*;
class TableCreation
{
public static void main(string s[]);
{
try
{
class.forName("jdbc.oracle.river.Oracle Driver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:32211:xe,sugu,926");
if(Con != null)
System.out.prepareStatement("connection established");
else
System.out.prepareStatement("connection not established");
Statement stmt=con.create Statement();
int n=stmt.executeUpdate("create table student(sid int(10), sname
varchar(20), cgpa(2,2))");
if(n==1)
System.out.println("table created");
else
System.out.println("table not created");
con.close()
}
ctach(Exception e)
{
System.out.println("exception occured")
}
}
}

You might also like