aspose file tools*
The moose likes JDBC and the fly likes Problem in output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem in output" Watch "Problem in output" New topic
Author

Problem in output

Dhivya rajagopal
Ranch Hand

Joined: Dec 15, 2010
Posts: 42

Hello, I have created the following program in net beans(database connection). I set up odbc connection also. Data source name-student. But when i run the program, no output is displayed. can you please tell, why output is not displayed?
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Did you check that the data got inserted in the database?


Mohamed Sanaulla | My Blog
Dhivya rajagopal
Ranch Hand

Joined: Dec 15, 2010
Posts: 42

No, i didn't check. I am using sql server 2005. should i create the table already?Should i set odbc connection every time before running the program?
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Dhivya rajagopal wrote:
No, i didn't check. I am using sql server 2005. should i create the table already?Should i set odbc connection every time before running the program?

There should be a table created before you insert some data into it. Creating a table is a one time and it can be done manually by running the SQL queries.
Dhivya rajagopal
Ranch Hand

Joined: Dec 15, 2010
Posts: 42

Thank you mohamed. I created one table . and run the program, I get the following error:

JDBC CONNECTION
**** **********
SQL EXCEPTION:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
BUILD SUCCESSFUL (total time: 2 seconds)
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Dhivya rajagopal wrote:

JDBC CONNECTION
**** **********
SQL EXCEPTION:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
BUILD SUCCESSFUL (total time: 2 seconds)

So the error message says what you are missing- user, password
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

You can spend sometime in reading this tutorial on JDBC


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in output