shailendra birthare

Greenhorn
+ Follow
since Jan 03, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by shailendra birthare

I am newbie to Java & JSP.

i'm using the following code in java file....can we use the same code in jsp file in scriptlet or as javascript......




Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
/* Setup the connection */
Connection connection = DriverManager.getConnection ("jdbc dbc:emp");


/*set auto commit to false*/
connection.setAutoCommit(false);
/*create statement*/
Statement statement = connection.createStatement();


/* String str = "insert into EmployeeData values '1','kirti','A',23100,'rtm','prakash')";*/


String str = "select * from EmployeeData where EmpID = '" + emp.getJ_empID() +"'";


/* Store no. of rows updated in result */
ResultSet rs = statement.executeQuery(str);




i'm trying to use it in javascript and for using that i'm impoting following in page directive as


<%@ page language="java" import="java.sql.Connection, java.sql.DriverManager, java.sql.ResultSet, java.sql.SQLException, java.sql.Statement" %>


but it is not working is there any other way to use this...


My objective is to get connect to database in JSP....

Please suggest other ways

Thanks in ADV...
18 years ago
JSP