Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by zhutong66 · Dec 18, 2016 at 01:56 AM · databasequery

I can link oracle 12c Database with unity3d,but cannot query any data,why?

I can link oracle 12c Database with unity3d,but cannot query any data.The same codes in other vs2015 program whitout unity3d are normal execution.I use the System.Data.OracleClient.dll.Any help would be very appreciated, thanks.

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using System;
 using System.Data;
 using System.Data.OracleClient;
 using UnityEngine.UI;
 
 public class LinkOracle : MonoBehaviour {
         public static OracleConnection conn;
     static string connectStr = "User ID=system;Password=Zhutong66;Data Source=MONITOR_ORCL;";
     
     String Query="select Assessment_Status from Record_Info_TB where Start_Date>=(sysdate-1/3600/24) and regexp_like(Assessment_Status,'^*.DANGEROUS$')";
 void Start () {
 
                 conn = new OracleConnection(connectStr);
                 string LinkStatus = conn.State.ToString();
                 Console.WriteLine(LinkStatus);
                 conn.Open();
                 string LinkStatus = conn.State.ToString();
                 Debug.Log(LinkStatus);
                  this.InvokeRepeating("Estimate",2.0f,0.5f);}
  private void Estimate(){
 
         OracleCommand ocd = new OracleCommand ();
         ocd.Connection = conn;
         ocd.CommandText = Query;
         ocd.CommandType = System.Data.CommandType.Text;
         //OracleDataReader odr = new OracleDataReader ();
         OracleDataReader odr = ocd.ExecuteReader();
         while(odr.Read()){
          Debug.Log("many data");
            }
      }
 }

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by AfroDieter · Sep 25, 2018 at 10:27 AM

I recommend using ManagedDriver. I finally figured out how. Just check my answer here: https://answers.unity.com/questions/142275/how-do-i-connect-to-an-oracle-database.html?childToView=1556476#answer-1556476

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jeffblumenthal · Jan 11, 2017 at 02:56 PM

Hi,

Could we please get more details?

So to confirm, you are able to connect to the Oracle 12c DB, yes? Did you setup an ODBC data source? If so, how.

Thank you.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jeffblumenthal · Jan 11, 2017 at 07:50 PM 0
Share

Ok, worked through this more.

I am having problems hitting an 11g instance using 5.5.0f3. $$anonymous$$y suspicion is the current set of drivers go up to 10g. Therefore I went 3rd party. I got https://www.devart.com/dotconnect/ working quickly. Note, I DO NOT work for them.

HTH

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

88 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can I add a table to a mySQL database using C#? 0 Answers

Vuforia Database Load Behaviour 1 Answer

Unity front end with LINQ and database entities - doable? 1 Answer

Firebase Offline Support? 1 Answer

Pass input values to database,Pass my Input Fields to database 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges