java.sql.*; sqlexception connection jdbc:subprotocol:subname jdbc:odbc:check static statement createstatement() throws sqlexception static statement createstatement(int resultsettype,int resultsetconcurrency) resultset types are :resultset.type_forward_only -default resultset.type_scroll_sensitive resultset.type_scroll_insensitive resultset concurrency are :resultset.concur_read_only resultset.concur_updatable
-default
databasemetadata getmetadata() preparedstatement preparestatement(string sql) //dml callablestatement preparecall(string sql)
//procedure or function
void commit() void rollback() void setautocommit(boolean value) void close() execute(string dml) statement resultset executequery(string sql) int executeupdate(string dml/ddl) boolean execute(string sql) //procedure or function resultset boolean next() boolean first() boolean last() boolean previous() void beforefirst() void afterlast() boolean absolute(int rowno) boolean relative(int num) int getrow() boolean boolean boolean boolean
isfirst() islast() isbeforefirst() isafterlast()
string getstring(string fieldname/int fieldno) int getint(string fieldname/int fieldno)
float getfloat(string fieldname/int fieldno) double getdouble(string fieldname/int fieldno) long getlong(string fieldname/int fieldno) blob getblob(string fieldname/int fieldno) date getdate(string fieldname/int fieldno) resultsetmetadata getmetadata() preparedstatement - to execute dml void setint(int fieldno,int value) void setstring(int fieldno,string value) void setfloat(int fieldno,float value) void setdouble(int fieldno,double value) int executeupdate() void clearparameters() callablestatement
- to call procedures and functions
void setint(int fieldno,int value) void setstring(int fieldno,string value) void setfloat(int fieldno,float value) void setdouble(int fieldno,double value) int executeupdate() resultsetmetadata int getcolumncount() string getcolumnname(int fieldno) string getcolumntype(int fieldno) int getscale(int fieldno) int getprecision(int fieldno) boolean isnullable(int fieldno) string gettablename(int fieldno) databasemetadata string getdatabaseproductname() string getdatabaseproductversion() resultset gettabletypes() string getdrivername() int getdrivermajorversion() int getdriverminorversion() string getdriverversion() drivermanager (class) static static public public public password)
void registerdriver(driver driver) void deregisterdriver(driver driver) static enumeration getdrivers() static driver getdriver(string url) static connection getconnection (string url, string uname, string