
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 317 Articles for JDBC

901 Views
The Statement interface represents the static SQL statement, it is used to create and execute general purpose SQL statements using Java programs.Creating a statementYou can create an object of this interface using the createStatement() method of the connection interface. Create a statement by invoking this method as shown below.Statement stmt = null; try { stmt = conn.createStatement( ); . . . } catch (SQLException e) { . . . } finally { . . . }Executing the Statement objectOnce you have created the statement object you can execute it using one of the execute methods namely, ... Read More

893 Views
This driver is known as a native API driver. This driver receives the calls from Java application and converts them in to vender specific native API calls. Here, we need to install The vendor-specific driver on the client machines.If we change the Database, we have to change the native API, as it is specific to a database and they are mostly obsolete now, but you may realize some speed increase with a Type 2 driver because it eliminates ODBC's overhead.Advantages of type2 driverFollowing are the advantages of the type2 driver.This type of driver fastest among all the 4 types of ... Read More

492 Views
The MySQL JDBC connection string look like this − Class.forName("com.mysql.jdbc.Driver"); Above, Driver is an interface. Whenever your JDBC is running outside an application server, then the class DriverManager establish the connection. The DriverManager class is as follows − conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/yourdatabaseName",”yourRootName","yourPassword"); Now, I am applying the above connection string to connect Java to MySQL database. The code is as follows. The following is the output that shows that MySQL connection with Java is successful.

3K+ Views
In the loop check, the result of i%2 operation on each element if 0 the element is even else the element is odd.ExampleLive Demopublic class OddNumbersInAnArray { public static void main(String args[]) { int[] myArray = {23, 93, 56, 92, 39}; System.out.println("Even numbers in the given array are:: "); for (int i=0; i

20K+ Views
Java provides ImageIO class for reading and writing an image. To convert a byte array to an image.Create a ByteArrayInputStream object by passing the byte array (that is to be converted) to its constructor.Read the image using the read() method of the ImageIO class (by passing the ByteArrayInputStream objects to it as a parameter).Finally, Write the image to using the write() method of the ImageIo class.Exampleimport java.io.ByteArrayOutputStream; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; public class ByteArrayToImage { public static void main(String args[]) throws Exception { BufferedImage bImage = ImageIO.read(new File("sample.jpg")); ... Read More

160 Views
Note that you need to check if Crystal Report for Enterprise 2016 support specific IBM DB2 version and for this you need to check product compatibility guide for development.Are you using Universe developed on IBM DB2 then you need to ensure that you are using correct version of drivers JDBC/ODBC in IDT to create a Relational connection. You also need to ensure that connection is also published to SAP BI repository. If your version of DB2 and Crystal Reports is ok, I would recommend you follow below steps:First steps is to start, you need to create a System DSN in ... Read More

1K+ Views
You are using the correct Port number for instance number “00”. Port number 300315, here 00 represents instance number of your HANA system.Try using HANA client jar file ngdbc.jar instead of SAP Jar file.try { Class.forName("com.sap.db.jdbc.Driver"); String url ="jdbc:sap://xx.x.x.xxx:30015/DBNAME"; //IP Address of HANAsystem followed by Port number String user ="user"; String password = "password"; Connection cn = java.sql.DriverManager.getConnection(url, user, password); ResultSet rs = cn.createStatement().executeQuery("CALL Test.STORED_PROC"); // ...Enter the action here } catch(Exception e) { e.printStackTrace(); }