Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

MY code is: public class P1{
public static void main(String ar[])
{
class.forName("java.lang.String");
}
}
errors i got are :New.java:5: error: <identifier> expected
class.forName("java.lang.String");
^
New.java:5: error: invalid method declaration; return type
required
class.forName("java.lang.String");
^
New.java:5: error: illegal start of type
class.forName("java.lang.String");
^
New.java:7: error: reached end of file while parsing
}
^
4 errors
HELP ME>......

Answer Posted / khasim

I think first error is...
1.Here in class name is Class.So we have to write Class.forName...(C caps)
2.forName() is used to register Driver.we have to specify any one of four drivers

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the steps involved in establishing a connection using jdbc in java?

975


Name the types of jdbc drivers.

904


How can you make a connection?

981


Why do I have to reaccess the database for Array, Blob, and Clob data?

1057


Can I enable requests to a jdbc connection pool for a database connection to wait until a connection is available?

887


What is an escape syntax?

984


What is the difference between ojdbc6 and ojdbc7?

876


How does a file store compare with a jdbc store?

1187


What is a jdbc connection?

890


What is java soft framework?

988


What is the jdbc rowset?

976


What is jdbc and jdbc drivers?

975


How to check jdbc connection in java?

930


What is the purpose of the jdbc resultset interface?

908


What is JDBC DataSource and what are it’s benefits?

1201