answersLogoWhite

0


Best Answer

JDBC mean Java Database Connectivity. In java, using JDBC drivers, we can connect to database.

Steps to connect to JDBC.

1) Load the driver, using Class.forName(DriverName);

2) Get the connection object, Connection con = Driver.getConnection(loaded driver name);

3) Create a SQL statement, Statement s = con.createStatement();

4) Create Resultset object using the statement created above, ResultSet rs = s.executeQuery("sql statement");

Iterate the result set to get all the values from the database.

Finally don't miss this

5) s.close();

6) con.close() ;

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

JDBC stands for Java Database Connectivity. A JDBC connection is required for every java program that wants to connect to a database for data

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Yes.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you connet java with sql in java programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the types of server controls that participate in declarative data binding model?

Java sql programming


Is learning SQL easy for a Java student?

SQL is quite unrelated to Java. It isn't exactly a programming language in the traditional sense; but rather a series of commands to get information from (and to) a database. The basics are actually quite simple; certainly simpler than learning Java.


Which language will be the best language to learn for computer programming in 2016?

C, C++, C#, Java, Python, HTML/CSS and SQL.


Is Oracle a programming language?

In C language Oracle is developed and after that enhancement is done in Java for 10g and 11g


Who are users of SQL programming?

The users of SQL Programming include database administrators(DBAs) and application developers. They use SQL programming to do daily tasks efficiently and correctly.


Can we use SQL for java language?

No. SQL stands for Structured Query Language and that in itself is a language and it is totally different from Java. However, you can use SQL queries inside Java code with the help of JDBC (Java DataBase Connectivity). But the Java compiler cannot understand/compile standalone SQL syntax unless it is used as part of JDBC.


What are the uses of java database connectivity?

Java Database Connectivity, a Java API that enables Java programs to execute SQL statements. This allows Java programs to interact with any SQL-compliant database.


Programming language used for hacking?

Top 10 programming language used for hacking: Python C++ C Programming SQL Javascript PHP JAVA Ruby Perl Bash


When people talk about java programming what java program do they mean?

"Java programming" refers to the act of creating programs - any programs - in the Java programming language. This is much like "C programming" refers to writing programs in the C programming language.


Database programming language?

Depends upon the database you are talking about MS SQL Server uses SQL and T-SQL programming languages. Oracle is also a SQl based language usings its own 'flavor' PSQL


What programming language are java applets written in?

Java applets are written in the Java programming language. Java is considered to be one of the oldest and most commonly used programming languages in the world.


What is the first name before of the Java Programming?

The first name of the Java Programming was Oak. It then went by the game Green and finally Java from Java coffee.