Home Answers Viewqa SQL Java to SQL Server Connectivity

 
 


Ahmad Waseem
Java to SQL Server Connectivity
0 Answer(s)      5 months ago
Posted in : SQL

Hi, heres my code

private void bookedButton() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn = DriverManager.getConnection("jdbc:odbc:BUS","","");

        Statement stmt= conn.createStatement();
    //  stmt.execute("Set identity_insert customers on");

        String current_status="BOOKED"; 


        emp =conn.prepareStatement("INSERT INTO customers (cust_name,cust_nic,cust_contact,cust_address,seat_no,departure_date,amount,total_amount,advance,remaining_amount,booking_date,checkin_date,current_status) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,'"+ current_status+"')");

        emp.setString(1, text1.getText());
        emp.setString(2, text2.getText());
        emp.setString(3, text4.getText());
        emp.setString(4, text3.getText());
        emp.setString(5, rtext2.getText());
        emp.setString(6, ctext2.getText());
        emp.setString(7, rtext3.getText());
        emp.setString(8, rtext4.getText());
        emp.setString(9, rtext5.getText());
        emp.setString(10, rtext6.getText());
        emp.setString(11, ctext1.getText());
        emp.setString(12, ctext3.getText());

        emp.executeUpdate();

    //  JOptionPane.showMessageDialog( this, "BOOKING SUCCESSFUL!","BOOKING RESULT", JOptionPane.PLAIN_MESSAGE );
    //  dispose();

    }
    catch(Exception e)
    {
        JOptionPane.showMessageDialog( this, "BOOKING UNSUCCESSFUL!\n\nAll Fields Mandatory\n\nCheck Either Seat is Available or Not","Error", JOptionPane.ERROR_MESSAGE );
        System.out.println(e.getMessage());

    }

}

Im making a ticket reservation system with sql server connectivity at the background to save the data. Now, after entering the data in the fields, i get two "General Eroor". I don't know if i made the connectivity wrong. Kindly help me resolve this issue ASAP. Thank you.

View Answers









Related Pages:
Java to SQL Server Connectivity
Java to SQL Server Connectivity  Hi, heres my code private void... with sql server connectivity at the background to save the data. Now, after... the connectivity wrong. Kindly help me resolve this issue ASAP. Thank you
sql connectivity through java
sql connectivity through java  i want an example for java db through sql connection. Thanks in advance
jsp sql server 2005 connectivity
jsp sql server 2005 connectivity  your jsp mysql tutorial is very help full.Please tell me how to connect jsp with SQL server 2005
mysql server connectivity - Java Server Faces Questions
mysql server connectivity  hello friends, my question is that i m not able to connect jsp, servlet with sql 2000. i know we have to do some changes in administrative tools in control pannel but after click
connectivity - JDBC
connectivity  How can we connect sql server using Java   Hi Friend, By using JDBC drivers, you can connect SQL server with java. Please visit the following link: http://www.roseindia.net/jdbc/jdbc.shtml
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou.  Hi Friend, Put mysql-connector
DataBase connectivity in java with Microsoft sql server2000 - JDBC
DataBase connectivity in java with Microsoft sql server2000  How i can achieve database connectivity with Microsoft sql server2000 in my java source code
JDBC, Java Database Connectivity
have in our site roseindia.net. Our website is very famous for JDBC and Java tutorials. Java Database Connectivity or JDBC for short is Java bases API... driver as per your application needs. About JDBC Java Database Connectivity
Java servlet sql connectivity error - JSP-Servlet
Java servlet sql connectivity error  Hi, I have been trying to connect to sql database via the servlet program in java.I have not been successful so far. However when i try to connect to sql through a normal java program
connectivity
connectivity  how to connect java with database
connectivity step
connectivity step  sir.pls give me step one by one for connect the java program to oracle.   Follow these steps: 1) Import the following packages in your java file:*** import java.sql.*; import oracle.jdbc.driver.
connectivity - JDBC
Exception report message description The server encountered an internal...) org.apache.jsp.gui1_jsp._jspService(gui1_jsp.java:142...(DriverManager.java:171) org.apache.jsp.gui1_jsp._jspService(gui1_jsp.java:70
JDBC - Java Database Connectivity Tutorial
JDBC - Java Database Connectivity Tutorials       Java Database Connectivity...; New Features in JDBC 4.0 Java database connectivity (JDBC) is the Java
Data base Connectivity
SQL server opened... data base.In configuring it is asking select Data server name and TNS.I typed Oracle for Data Server Name and IN TNS what to type? I pulled the list for TNS
Chapter 4. Demonstrate understanding of database connectivity and messaging within IBM WebShpere Application Server
The base SQL query is defined as a Java String.... Metadata in the object maps Java data types to SQL data types (as well... connectivity and messaging within IBM WebShpere Application ServerPrev Part I
java servlet connectivity problem with access
java servlet connectivity problem with access  Import java.sql javax.servlet //all packages entered try { Class.forName... an SQL query, get a ResultSet ResultSet rs = st.executeQuery("SELECT NAME
database connectivity using mysql
database connectivity using mysql  java file: eg1.java package eg; import java.sql.*; public class eg1 { public static void main(String arg... seconds) I am using Netbeans 5.5, mysql server 5.0, to get data from table
jdbc odbc sql server exception
jdbc odbc sql server exception  Hi, I am trying to use sql server with java jdbc odbc but I am getting this exception java.sql.SQLException: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '@P1
Java servlet with jsp on sql server
Java servlet with jsp on sql server  How to delete a user by an admin with check box in Java Servlet with jsp on Sql Server?   Here is a jsp example that can delete the multiple record from the database by selecting
jdbc connectivity through jsp
jdbc connectivity through jsp  my code: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>... Exception report message description The server encountered an internal error
SQL Server
SQL Server  Hii, What is SQL Server ?   hello, SQL Server is a DBMS system provided by Microsoft
java connectivity
java connectivity  hi........ Can u help me to do connectivity between java and weka??????? weka is a data mining tool which allows to do prediction, classification etc.... i want to do connectivity between weka and java can u
Check PHP MySQL Connectivity
Check PHP MySQL Connectivity: The first step of any kind of connectivity is to check whether the connectivity has been established or not. To check the connectivity we need to know three things: The host name, Username, and respective
Java vs Oracle Connectivity - JDBC
Java vs Oracle Connectivity  Write a java program to establish connection with oracle database?  Hi Friend, Use Oracle with Java Follow these steps: 1) Import the following packages in your java file
java and sql server NOT Mysql - JSP-Servlet
java and sql server NOT Mysql  Hi guys. Thank you all for the various helps you render to everyone. Please the question I asked the last time... image from MS SQL server NOT MySQL. Or is it not possible to do it in MS SQL server
database connectivity
database connectivity  how to create database connectivity between HTML and sql server2005
sql server - SQL
sql server  what is SQL server? & what is oracle? are they same
Error while SQL Server connection to Java
Error while SQL Server connection to Java  import java.sql.*; public..."); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER;user=DTHOTA;password...("password", " "); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER", prop
Error while SQL Server connection to Java
Error while SQL Server connection to Java  import java.sql.*; public..."); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER;user=DTHOTA;password...("password", " "); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER", prop
sql server - SQL
sql server  How many no of tables can be joined in same sql server
To retrieve image from SQL Server Database - Java Server Faces Questions
To retrieve image from SQL Server Database  Sir/Madam, I am trying to retrieve image from SQL Server 2000 database in Visual Web JSF Page using... or in Image Component. please help me in retrieving and displaying image from SQL Server
database connectivity
database connectivity  describe java program steps in order to get connectivity to database along with example
JDBC-Odbc Connectivity
JDBC-ODBC Connectivity     ... Connectivity. The code helps you in retrieve the name and size of the column... between front-end application in java and database in the backend.  
jsp page connectivity with oracle - SQL
jsp page connectivity with oracle  I am unable to database connectivity jsp with oracle. Please send the code for solving problem. thanks  Hi Friend, 1)Import the packages: 2)Load the oracle driver
java connectivity
java connectivity  i am trying to add dyanamic rows in the jsp page, when i add the new row the dropdown control value is not coming from database..please help me to overcome this problem
connectivity with mysql
connectivity with mysql  if this code of roseindia doesnt work,then what to do..cant connect with my sql http://www.roseindia.net/tutorial/php.../tutorial/php/phpdatabase/ http://www.roseindia.net/sql/mysql-example/php-mysql
Sql Server - SQL
sql server trigger example  Can any one tell me the live example of triggers in SQL Server?   if u click pistal trigger ,it auotmatically shoot bullet it's like newtons 3rd law (every action s having an equal reaction
How to read textfile and create SQL server table ?
How to read textfile and create SQL server table ?  hi sir, your site... trying to read textfile and create table in sql server but it gives error.../questions/16415498/creating-a-table-in-sql-database-by-reading-textfile-in-java
create a xml from sql server 2005 - XML
create a xml from sql server 2005  hello Dear, i want to know how we create a xml file which retrieve data from Sql server 2005 using java. i am briefing my problem as follows. let i have a table in sql server 2005
JDBC CONNECTIVITY
file in environment variable.   Java Mysql connectivity Other JDBC...JDBC CONNECTIVITY  How do i connect my database to java. I have the connector file and i place it in lib of jdk folder and installed the jdbc driver
JDBC CONNECTIVITY
// File name: Document [1].java /** * This class is generated from template... but when we run application i have an error message like this..." (""""""Java Tools.... Exception in thread "main" 'Java Tools >> Run Application' tool
Database Connectivity
Database Connectivity  I tried to establish database connection with sqlserver2008 through GlassFish server. When I set the path of sqljdbc.jar(E:\Glass Fish\glassfish-v2ur1\javadb\lib\sqljdbc.jar) it shows me error
JDBC (Java Database Connectivity) -Tutorials
JDBC (Java Database Connectivity) -Tutorials  .... In this overview, we discuss about the role of Java Database Connectivity... us, Java's database connectivity allows us to concentrate
XML in SQL Server
XML in SQL Server  Hi..... please anyone tell me about What is the purpose of FOR XML in SQL Server? Thanks
SQL or UNICODE - SQL
...... I had also change my backhand to SQL SERVER but retrieves same for UNICODE...SQL or UNICODE   Hi again............ I have got something new that........... i was using MS Access as the database with my JAVA Japplet
J2ME connectivity to ms access
J2ME connectivity to ms access  How to establish client server connectivity to access ms access database on the server side? I have made the odbc connection. Plz help me in the coding part.. Dont know how to start
date problem in sql server - SQL
date problem in sql server  select count(*) from xxxx_tbl where emplid="+emplid+" and work_dt=#"+work_date+"#"; work_date is in string ,Backend is sql server 2000.i am getting the date problem when using in jsp page.  
Validate telnet connectivity
Validate telnet connectivity  How to validate telnet connectivity in my java code

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.