aspose file tools*
The moose likes JDBC and the fly likes Type-IV Driver with servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Type-IV Driver with servlet" Watch "Type-IV Driver with servlet" New topic
Author

Type-IV Driver with servlet

Sachin Dimble
Ranch Hand

Joined: Dec 07, 2005
Posts: 100
Hi!
I tried Type IV Driver for Servlet.

CODE:

public class ora extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
{
Connection con;
Statement stat;
ResultSet rs;
res.setContentType("text/html");
PrintWriter out=res.getWriter();
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Loaded ..");
con=DriverManager.getConnection"jdbc racle:thin:@saraswati:1521 racle9","java","java");
}catch(SQLException e)
{
System.out.println(e.getMessage());
return;
}
catch(ClassNotFoundException e)
{
System.out.println(e.getMessage());
return;
}
try{
stat=con.createStatement();
out.println("Error after this stat");
rs=stat.executeQuery("select * from sac");

out.println("<b><font size='4' color='black'>The Database</font></b>");
out.println("<table size='2'>");
while(rs.next())

out.println("<b><tr><td>"+rs.getInt(1)+"</td><td>"+rs.getString(2)+"</b></td></tr>");
out.println("</table>");
}catch(SQLException e)
{
out.println(e);
return;
}finally
{
try{

con.close();}catch(SQLException s){}
return;
}
}
}


THE ERROR:
Error after this stat java.sql.SQLException: ORA-00600: internal error code, arguments: [ttcgcshnd-1], [0], [], [], [], [], [], []

Could anybody suggest how to troubleshoot it?

Thanx In Advance!
Sachin Dimble.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Are you able to connect the DB via SQLPlus or something like that?
Are you able top use any other type of JDBC driver?

I found while googling around,

ORA-00600:internal error code, arguments: [string], [string], [string], [string], [string], [string], [string], [string]
Cause:This is the generic internal error number for Oracle program exceptions. It indicates that a process has encountered a low-level, unexpected condition. Causes of this message include:

* timeouts
* file corruption
* failed data checks in memory
* hardware, memory, or I/O errors
* incorrectly restored files

The first argument is the internal message number. Other arguments are various numbers, names, and character strings. The numbers may change meanings between different versions of Oracle.
Action:Report this error to Oracle Support Services after gathering the following information:

* events that led up to the error
* the operations that were attempted that led to the error
* the conditions of the operating system and databases at the time of the error
* any unusual circumstances that occurred before receiving the ORA-00600 message
* contents of any trace files generated by the error
* the relevant portions of the Alter files

Note: The cause of this message may manifest itself as different errors at different times. Be aware of the history of errors that occurred before this internal error.
Sachin Dimble
Ranch Hand

Joined: Dec 07, 2005
Posts: 100
Thanx Addel for responding.
I too tried same googling. I am able to connect it through sqlPlus but not through this code it seems to Execution query time out error(if go through code).

Sachin Dimble.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Have you checked trace file written in the user_dump_dest or background_dump_dest directory. The name for the trace file written is recorded in the alert.log.

And have you tried some other driver??
Sachin Dimble
Ranch Hand

Joined: Dec 07, 2005
Posts: 100
I didn't got such trace file. This code is perfectly work for console application not tried any other driver but know that Type II works finely.

Sachin Dimbke.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
If using OCI Driver



If using thin driver

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Type-IV Driver with servlet