Question about Computers & Internet

1 Answer

JDBC I am working on a project in java.I want to retrieve results from database in a tabular format with the help of resultdata,metadata function. Please help?????

Posted by on

  • deep4s3 Mar 01, 2008

    Please make it quickly

×

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    Hot-Shot:

    An expert who has answered 20 questions.

    Corporal:

    An expert that has over 10 points.

    Mayor:

    An expert whose answer got voted for 2 times.

  • Contributor
  • 30 Answers

Steps to retrieve results.

create the driver.
Class.forName(" ");
create a connection.
Connection con_name=DriverManager.getConnection("Dbname","coloumn name");
create statement
Statement stmt_name=con_name.createStatement();
To retrieve resule fron DB use the below codes

ResuleSet rs;
rs=stmt_name.executeQuery("select * from DB name");

Posted on Jul 10, 2008

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

When I trying to open the archive files, error "RRV Bucket is corrupted" is displayed. I am unable to solve this problem. can you please provide a solution. I understand data can be retrieved ,...


If this error occurs in a case where Shared Mail is being used, then first refer to the documents titled "'RRV Buffer Overflow' Error Message While Attempting to View a Mail Document" (#1093390) and "Using the OBJECT COLLECT Server Task to Manage Shared Mail Databases" (#1088860).

If the database is not in R5 format (ODS 41), then from a Domino 4.x server run Compact -M on the database. On a Domino 5.x server simply run Compact on the database. If updating the ODS to 41 does not resolve the issue, refer to the document titled "Database Has Grown too Large; Use File New Replica...' Error Occurs When Opening Local Database" (#1102305).

If none of the above resolves the issue, then where possible, a new replica should be made. If a replica is not available, restore the database from a backup, if one exists.

Supporting Information:
Corruption can be caused by many things, but a possible cause for the error in this case was that a third-party application had altered the physical location of the database on the hard disk, resulting in the Record Relocation Vector table being incorrect and the information not being located. This has been reported to happen with customers using a disk defragment utility while Compact is running.

May 28, 2011 | Computers & Internet

1 Answer

I have to make minor project on java and i know core java and jdbc odbc connectivity will u please help me


It would probably be wise to post this on a Java forum (like this one, this one, or this one), as they will be able to help you better.

Alternatively, try Stack Overflow.

Feb 19, 2010 | Microsoft Windows XP Professional

1 Answer

Sir I m a Computer Science student from indore.I have to submit project based on java and as I m a beginner in java I cant get perfect project for me.I m looking for a good project.Students are making lots...


Dear User,

You can get some inspiration from the subjects below:

1. Creation of a DMZ
2. Creation of a sniffer and a port scanner
3. GSM
4. Timetable generation (user will input subjects, faculty times, class room times) : User will also input subject seriality and topics to be taken for the week.
5. Admission procedure
6. Online passport registeration
7. Examination result according to the classes
8. Ice cream parlour management system
9. Pizza hut - account management system
10. Multi player strategy game: Project ideas on Visual basic,Java,Database
11. You can develop a speech reponse application using some hardware interface using the Microsoft SAPI SDK
12. You can develop a Microsoft Word like application in VB ( a text editor basically)
13. You can develop a LAN administrator tool (socket programming comes easy in VB) which will monitor application on a LAN and provide functions
14. Voice Mail Systems
15. Computer Telephony Integration

Hope this is helpful for you.

Thanks

Feb 01, 2010 | Microsoft Windows XP Professional

1 Answer

How can i connect the data base during my project


That seems fine.

I cant assume your level of confidence in programming, however, following are some simple steps you can follow to achieve (for complex implementations, much more time and details will be needed, i can help u with them as well)

1. Create a database in Access ( i assume u r using Access 2003)
2. Create a System DSN (if aren't clear, how to create then goto administrative tools under control panel and you'll find Data Sources (ODBC), here u need to create System level DSN for Access driver (may be Jet 4.0+)
3. In java, you need to import java core libraries for sql (javax.sql package specially)
4. you are almost done, just google for database code in java, simple code will be around 5-10 lines (just for your reference, search with these keywords, ClassName(""), jdbc:odbc:YourDSN)
5. Open a connection using Connection object
6. Fetch the records (select query) using Recordset object
7. You're done.

thanks
Kuldeep

Mar 13, 2009 | HP Computers & Internet

2 Answers

How to connect from jsp login page to database


hey try this code......just found it on the net... Put the code in tomcat and test the application through browser. The browser should display the display the data stored in the table.

Here is the code of our JSP file
<%@ page language="java" import="java.sql.*"%>
<html>
<head><title>Read from mySQL Database</title>
</head>
<body>

<p align="center"><b>Following records are selected from the 'jakartaproject' table.</b><br>&nbsp;</p>

<div align="center" width="85%">
<center>
<table border="1" borderColor="#ffe9bf" cellPadding="0" cellSpacing="0" width="658" height="63">
<tbody>
<td bgColor="#008080" width="47" align="center" height="19"><font color="#ffffff"><b>Sr.
No.</b></font></td>
<td bgColor="#008080" width="107" height="19"><font color="#ffffff"><b>Project</b></font></td>
<td bgColor="#008080" width="224" height="19"><font color="#ffffff"><b>Url
Address</b></font></td>
<td bgColor="#008080" width="270" height="19"><font color="#ffffff"><b>Description
of the project</b></font></td>

<%
String DRIVER = "org.gjt.mm.mysql.Driver";
Class.forName(DRIVER).newInstance();


Connection con=null;
ResultSet rst=null;
Statement stmt=null;

try{
String url="jdbc:mysql://192.168.10.2/tutorial?user=tutorial&password=tutorial";

int i=1;
con=DriverManager.getConnection(url);
stmt=con.createStatement();
rst=stmt.executeQuery("select * from jakartaproject ");
while(rst.next()){

if (i==(i/2)*2){
%>
<tr>
<td bgColor="#ffff98" vAlign="top" width="47" align="center" height="19"><%=i%>.</td>
<td bgColor="#ffff98" vAlign="top" width="107" height="19"><%=rst.getString(2)%></td>
<td bgColor="#ffff98" vAlign="top" width="224" height="19"><a href="<%=rst.getString(3)%>"><%=rst.getString(3)%></a>&nbsp;</td>
<td bgColor="#ffff98" vAlign="top" width="270" height="19"><%=rst.getString(4)%></td>
</tr>
<%
}else{
%>
<tr>
<td bgColor="#ffcc68" vAlign="top" width="47" align="center" height="19"><%=i%>.</td>
<td bgColor="#ffcc68" vAlign="top" width="107" height="19"><%=rst.getString(2)%></td>
<td bgColor="#ffcc68" vAlign="top" width="224" height="19"><a href="<%=rst.getString(3)%>"><%=rst.getString(3)%></a>&nbsp;</td>
<td bgColor="#ffcc68" vAlign="top" width="270" height="19"><%=rst.getString(4)%></td>
</tr>
<% }

i++;
}
rst.close();
stmt.close();
con.close();
}catch(Exception e){
System.out.println(e.getMessage());
}
%>

</tbody>
</table>
</center>
</div>


</body>
</html>

Feb 27, 2009 | Compaq Computers & Internet

1 Answer

How to write jdbc connections


http://www.jdbc-tutorial.com/

window.google_render_ad();

welcome_title_image.gif Java JDBC Tutorial Java JDBC Tutorial
The JDBC ( Java Database Connectivity) API defines interfaces and classes for writing database applications in Java by making database connections. Using JDBC you can send SQL, PL/SQL statements to almost any relational database. JDBC is a Java API for executing SQL statements and supports basic SQL functionality. It provides RDBMS access by allowing you to embed SQL inside Java code. Because Java can run on a thin client, applets embedded in Web pages can contain downloadable JDBC code to enable remote database access. You will learn how to create a table, insert values into it, query the table, retrieve results, and update the table with the help of a JDBC Program example.


window.google_render_ad();
Although JDBC was designed specifically to provide a Java interface to relational databases, you may find that you need to write Java code to access non-relational databases as well.
JDBC Architecture jdbc.jpg Java application calls the JDBC library. JDBC loads a driver which talks to the database. We can change database engines without changing database code.
JDBC Basics - Java Database Connectivity Steps Before you can create a java jdbc connection to the database, you must first import the
java.sql package.
import java.sql.*; The star ( * ) indicates that all of the classes in the package java.sql are to be imported.
1. Loading a database driver,
In this step of the jdbc connection process, we load the driver class by calling Class.forName() with the Driver class name as an argument. Once loaded, the Driver class creates an instance of itself. A client can connect to Database Server through JDBC Driver. Since most of the Database servers support ODBC driver therefore JDBC-ODBC Bridge driver is commonly used.
The return type of the Class.forName (String ClassName) method is “Class”. Class is a class in
java.lang package.
try { Class.forName(”sun.jdbc.odbc.JdbcOdbcDriver”); //Or any other driver } catch(Exception x){ System.out.println( “Unable to load the driver class!” ); } 2. Creating a oracle jdbc Connection

The JDBC DriverManager class defines objects which can connect Java applications to a JDBC driver. DriverManager is considered the backbone of JDBC architecture. DriverManager class manages the JDBC drivers that are installed on the system. Its getConnection() method is used to establish a connection to a database. It uses a username, password, and a jdbc url to establish a connection to the database and returns a connection object. A jdbc Connection represents a session/connection with a specific database. Within the context of a Connection, SQL, PL/SQL statements are executed and results are returned. An application can have one or more connections with a single database, or it can have many connections with different databases. A Connection object provides metadata i.e. information about the database, tables, and fields. It also contains methods to deal with transactions.
JDBC URL Syntax:: jdbc: <subprotocol>: <subname> JDBC URL Example:: jdbc: <subprotocol>: <subname>•Each driver

Feb 01, 2009 | Microsoft Windows XP Home Edition

1 Answer

Java


Hello Sir,


The Spring Framework (or Spring for short) is an open source application framework for the Java platform. The first version was written by Rod Johnson, who first released it with the publication of his book Expert One-on-One J2EE Design and Development (Wrox Press, October 2002). A port is available for the .NET Framework.[1]
The framework was first released under the Apache 2.0 license in June 2003. The first milestone release, 1.0, was released in March 2004, with further milestone releases in September 2004 and March 2005.
Although the Spring Framework does not enforce any specific programming model, it has become popular in the Java community as an alternative, replacement, or even addition to the Enterprise JavaBean model. By design, the framework offers a lot of freedom to Java developers yet provides well documented and easy-to-use solutions for common practices in the industry.
While the core features of the Spring Framework are usable in any Java application, there are many extensions and improvements for building web-based applications on top of the Java Enterprise platform. Spring has gained a lot of popularity because of this, and is recognized by vendors as a strategically important framework.



The Spring Framework provides solutions to many technical challenges faced by Java developers and organizations wanting to create applications based on the Java platform. Because of the sheer vastness of the functionality offered, it can be hard to distinguish the major building blocks from which the framework is composed. The Spring Framework is not exclusively linked to the Java Enterprise platform, although its far-reaching integration in this area is an important reason for its popularity.
The Spring Framework is probably best known for offering features required to create complex business applications effectively outside of the programming models which have been dominant historically in the industry. Next to that, it is also credited for introducing previously unfamiliar functionalities into today's mainstream development practices, even beyond the Java platform.
This amounts to a framework which offers a consistent model and makes it applicable to most application types created on top of the Java platform today.
[Modules of the Spring Framework The Spring Framework can be considered as a collection of smaller frameworks. Most of these frameworks are designed to work independently of each other yet provide better functionalities when used together. These frameworks are divided along the building blocks of typical complex applications:
  • Inversion of Control container: configuration of application components and lifecycle management of Java objects.
  • Aspect-oriented programming framework: working with functionalities which cannot be implemented with Java's object-oriented programming capabilities without making sacrifices.
  • Data access framework: working with relational database management systems on the Java platform using JDBC and Object-relational mapping tools providing solutions to technical challenges which are reusable in a multitude of Java-based environments.
  • Transaction management framework: harmonization of various transaction management API's and configurative transaction management orchestration for Java objects.
  • Model-view-controller framework: HTTP and Servlet based framework providing many hooks for extension and customization.
  • Remote Access framework: configurative RPC-style export and import of Java objects over computer networks supporting RMI, CORBA and HTTP-based protocols including web services (SOAP).
  • Authentication and authorization framework: configurative orchestration of authentication and authorization processes supporting many popular and industry-standard standards, protocols, tools and practices via the Acegi sub-project.
  • Remote Management framework: configurative exposure and management of Java objects for local or remote configuration via JMX.
  • Messaging framework: configurative registration of message listener objects for transparent message consumption from message queues via JMS, improvement of message sending over standard JMS API's.
  • Testing framework: support classes for writing unit tests and integration tests.

Mar 11, 2008 | Microsoft Windows XP Professional With...

1 Answer

Final yr project


Nice project you can easy solve this problem first you want to known how to connect the java with sql or some other database. http://www.academictutorials.com/ this is the site this help you for your project. If you have any problem just contact me i will clear it.

Feb 17, 2008 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

145 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

kakima

Level 3 Expert

98796 Answers

David Payne
David Payne

Level 3 Expert

14071 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...