how can we get the metaData (columnNames) from a table which
has no Records..
Answers were Sorted based on User's Feedback
Answer / sreenivas
Hi,
You can use DatabasrMetaData class to get the databse
information like... schenmaname, tables, columnnames,
etc....
DatabaseMetaData metaData = new DBConnection().getMetaData
();
Is This Answer Correct ? | 2 Yes | 1 No |
dear friends I have made connection with SQLSERVER where the following code is compiling properly but giving error at the runtime . I think error in this line where i am sending the value through string Connection connection = DriverManager.getConnection ( "jdbc:microsoft:sqlserver://localhost:1433","sa",""); import java.sql.*; //import mssqlserver.*; public class TestSQLCON { public TestSQLCON() throws Exception { // Get connection DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver()); System.out.println(); System.out.println("Successfully connected one"); System.out.println(); Connection connection = DriverManager.getConnection ( "jdbc:microsoft:sqlserver://localhost:1433","sa",""); if (connection != null) { System.out.println(); System.out.println("Successfully connected"); System.out.println(); // Meta data DatabaseMetaData meta = connection.getMetaData(); System.out.println("\nDriver Information"); System.out.println("Driver Name: " + meta.getDriverName()); System.out.println("Driver Version: " + meta.getDriverVersion()); System.out.println("\nDatabase Information "); System.out.println("Database Name: " + meta.getDatabaseProductName()); System.out.println("Database Version: "+ meta.getDatabaseProductVersion()); } } public static void main (String args[]) throws Exception { TestSQLCON test = new TestSQLCON(); } } so please help me
What is the difference between executing, executequery, executeupdate in jdbc?
What is the jdbc rowset?
Hi........I need to create a dropdown box using java.....this box should show the values that should be taken from the database...... Thank you....
Which of the attributes in the monitoring tab for a jdbc connection pool in the administrative console tell us how many clients are currently waiting for a connection?
What is the execute method in java?
Why “no suitable driver” error occurs?
What are the differences between resultset and rowset?
How to use JDBC API to call Stored Procedures?
What is JDBC Statement?
What is a jdbc url?
What is sqlwarning and discuss the procedure of retrieving warnings?